Struct lopdf::Document [−][src]
pub struct Document {
pub version: String,
pub trailer: Dictionary,
pub reference_table: Xref,
pub objects: BTreeMap<ObjectId, Object>,
pub max_id: u32,
pub max_bookmark_id: u32,
pub bookmarks: Vec<u32>,
pub bookmark_table: HashMap<u32, Bookmark>,
}
Expand description
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: Xref
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.
max_bookmark_id: u32
Current maximum object id within Bookmarks.
bookmarks: Vec<u32>
The bookmarks in the document. Render at the very end of document after renumbering objects.
bookmark_table: HashMap<u32, Bookmark>
used to locate a stored Bookmark so children can be appended to it via its id. Otherwise we need to do recrusive lookups and returns on the bookmarks internal layout Vec
Implementations
Adjusts the Parents that have a ObjectId of (0,_) to that of their first child. will recruse through all entries till all parents of children are set. This should be ran before building the final bookmark objects but after renumbering of objects.
Follow references if the supplied object is a reference.
Returns a tuple of an optional object id and final object. The object id will be None if the object was not a reference. Otherwise, it will be the last object id in the reference chain.
Get object by object id, will iteratively dereference a referenced object.
Get mutable reference to object by object id, will iteratively dereference a referenced object.
Get page object_id of the specified object object_id
Get dictionary object by id.
Traverse objects from trailer recursively, return all referenced object IDs.
Get catalog dictionary.
Get page numbers and corresponding object ids.
Get content stream object ids of a page.
Get resources used by a page.
Get fonts used by a page.
Change producer of document information dictionary.
Decompress PDF stream objects.
Delete pages.
Prune all unused objects.
Delete object by object ID.
Delete zero length stream objects.
Renumber objects, normally called after delete_unused_objects.
Renumber objects with a custom starting id, this is very useful in case of multiple document objects insertion in a single main document
Load a PDF document from a specified file path.
Load a PDF document from an arbitrary source.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Document
impl UnwindSafe for Document
Blanket Implementations
Mutably borrows from an owned value. Read more