Skip to main content

hayro_syntax/
metadata.rs

1//! Reading document metadata.
2
3use crate::object::DateTime;
4use alloc::vec::Vec;
5
6#[derive(Clone, Default, Debug, PartialEq, Eq)]
7/// The metadata of a PDF document.
8pub struct Metadata {
9    /// The creation date of the document.
10    pub creation_date: Option<DateTime>,
11    /// The modification date of the document.
12    pub modification_date: Option<DateTime>,
13    /// The title of the document.
14    ///
15    /// In the vast majority of cases, this is going to be an ASCII string, but it doesn't have to
16    /// be.
17    pub title: Option<Vec<u8>>,
18    /// The author of the document.
19    ///
20    /// In the vast majority of cases, this is going to be an ASCII string, but it doesn't have to
21    /// be.
22    pub author: Option<Vec<u8>>,
23    /// The subject of the document.
24    ///
25    /// In the vast majority of cases, this is going to be an ASCII string, but it doesn't have to
26    /// be.
27    pub subject: Option<Vec<u8>>,
28    /// The keywords of the document.
29    ///
30    /// In the vast majority of cases, this is going to be an ASCII string, but it doesn't have to
31    /// be.
32    pub keywords: Option<Vec<u8>>,
33    /// The creator of the document.
34    ///
35    /// In the vast majority of cases, this is going to be an ASCII string, but it doesn't have to
36    /// be.
37    pub creator: Option<Vec<u8>>,
38    /// The producer of the document.
39    ///
40    /// In the vast majority of cases, this is going to be an ASCII string, but it doesn't have to
41    /// be.
42    pub producer: Option<Vec<u8>>,
43}