pub enum PdfObject<'a> {
Boolean(bool),
Integer(i32),
Real(f32),
String(PdfString<'a>),
Name(&'a [u8]),
Array(Vec<PdfObject<'a>>),
Dictionary(PdfUntypedDictionary<'a>),
Stream(PdfStreamObject<'a>),
Reference(PdfObjectIdentifier),
Null,
}
Expand description
From section 7.3.1 of the PDF specification: “PDF includes eight basic types of objects: Boolean values, Integer and Real numbers, Strings, Names, Arrays, Dictionaries, Streams, and the null object”
Variants§
Boolean(bool)
Section 7.3.2: “Boolean objects represent the logical values of true and false. They appear in PDF files using the keywords true and false.”
Integer(i32)
Section 7.3.3: “Integer objects represent mathematical integers. Real objects represent mathematical real numbers. The range and precision of numbers may be limited by the internal representations used in the computer on which the conforming reader is running; Annex C gives these limits for typical implementations.”
Section C.2 specifies this as 32-bit signed integer.
Real(f32)
Section 7.3.3: “Real objects represent mathematical real numbers. The range and precision of numbers may be limited by the internal representations used in the computer on which the conforming reader is running; Annex C gives these limits for typical implementations.”
Section C.2 specifies this as 32-bit floating point number.
String(PdfString<'a>)
Section 7.3.3: “A string object shall consist of a series of zero or more bytes. String objects are not integer objects, but are stored in a more compact format. The length of a string may be subject to implementation limits; see Annex C.”
Annex C specifies the maximum string length as 32767.
Name(&'a [u8])
Section 7.3.5: “[..] a name object is an atomic symbol uniquely defined by a sequence of any characters (8-bit values) except null (character code 0). Uniquely defined means that any two name objects made up of the same sequence of characters denote the same object. Atomic means that a name has no internal structure; although it is defined by a sequence of characters, those characters are not considered elements of the name.”
Array(Vec<PdfObject<'a>>)
Section 7.3.6: “An array object is a one-dimensional collection of objects arranged sequentially. Unlike arrays in many other computer languages, PDF arrays may be heterogeneous; that is, an array’s elements may be any combination of numbers, strings, dictionaries, or any other objects, including other arrays. An array may have zero elements.”
Dictionary(PdfUntypedDictionary<'a>)
Stream(PdfStreamObject<'a>)
Section 7.3.8: “A stream object, like a string object, is a sequence of bytes. Furthermore, a stream may be of unlimited length, whereas a string shall be subject to an implementation limit. For this reason, objects with potentially large amounts of data, such as images and page descriptions, shall be represented as streams.”
Reference(PdfObjectIdentifier)
A reference to an indirect object, represented as “