Struct lopdf::Document
[−]
[src]
pub struct Document { pub version: String, pub trailer: Dictionary, pub reference_table: BTreeMap<u32, (u16, u64)>, pub objects: BTreeMap<ObjectId, Object>, pub max_id: u32, }
PDF document.
Fields
version: String
The version of the PDF specification to which the file conforms.
trailer: Dictionary
The trailer gives the location of the cross-reference table and of certain special objects.
reference_table: BTreeMap<u32, (u16, u64)>
The cross-reference table contains locations of the indirect objects.
objects: BTreeMap<ObjectId, Object>
The objects that make up the document contained in the file.
max_id: u32
Current maximum object id within the document.
Methods
impl Document
[src]
fn new() -> Document
Create new PDF document.
fn get_object(&self, id: ObjectId) -> Option<&Object>
Get object by object id, will recursively dereference a referenced object.
impl Document
[src]
impl Document
[src]
fn save<P: AsRef<Path>>(&mut self, path: P) -> Result<File>
Save PDF document to specified file path.
impl Document
[src]
fn add_object<T: Into<Object>>(&mut self, object: T) -> ObjectId
Add PDF object into document's object list.
impl Document
[src]
fn compress(&mut self)
Compress PDF stream objects.
fn decompress(&mut self)
Decompress PDF stream objects.