pub enum PdfObject {
Null,
Boolean(bool),
Integer(i64),
Real(f64),
Name(String),
LiteralString(String),
Array(Vec<PdfObject>),
Dictionary(Vec<(String, PdfObject)>),
Stream {
dict: Vec<(String, PdfObject)>,
data: Vec<u8>,
},
Reference(ObjId),
}Expand description
Represents PDF object types per PDF 32000-1:2008 Section 7.3.
Variants§
Null
PDF null object.
Boolean(bool)
PDF boolean object.
Integer(i64)
PDF integer object.
Real(f64)
PDF real (floating-point) object.
Name(String)
PDF name object (stored without the leading /).
LiteralString(String)
PDF literal string (stored without the enclosing parens).
Array(Vec<PdfObject>)
PDF array object.
Dictionary(Vec<(String, PdfObject)>)
Key-value pairs. Uses Vec for deterministic output order.
Stream
PDF stream object: a dictionary plus a byte sequence.
Fields
Reference(ObjId)
Indirect object reference (N G R).
Implementations§
Source§impl PdfObject
impl PdfObject
Sourcepub fn name(s: &str) -> Self
pub fn name(s: &str) -> Self
Construct a Name object from a string slice (without the leading /).
Sourcepub fn literal_string(s: &str) -> Self
pub fn literal_string(s: &str) -> Self
Construct a LiteralString object from a string slice.
Sourcepub fn reference(obj_num: u32, gen: u16) -> Self
pub fn reference(obj_num: u32, gen: u16) -> Self
Construct a Reference object from an object number and generation number.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PdfObject
impl RefUnwindSafe for PdfObject
impl Send for PdfObject
impl Sync for PdfObject
impl Unpin for PdfObject
impl UnsafeUnpin for PdfObject
impl UnwindSafe for PdfObject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more