Struct lopdf::IncrementalDocument
source · pub struct IncrementalDocument {
pub new_document: Document,
/* private fields */
}
Fields§
§new_document: Document
A new document appended to the previously loaded file.
Implementations§
source§impl IncrementalDocument
impl IncrementalDocument
sourcepub fn create_from(prev_bytes: Vec<u8>, prev_documents: Document) -> Self
pub fn create_from(prev_bytes: Vec<u8>, prev_documents: Document) -> Self
Create new IncrementalDocument
from the bytes and document.
The function expects the bytes and previous document to match. If they do not match exactly this might result in broken PDFs.
sourcepub fn get_prev_documents(&self) -> &Document
pub fn get_prev_documents(&self) -> &Document
Get the structure of the previous documents (all prev incremental updates combined.)
sourcepub fn get_prev_documents_bytes(&self) -> &[u8] ⓘ
pub fn get_prev_documents_bytes(&self) -> &[u8] ⓘ
Get the bytes of the previous documents.
sourcepub fn opt_clone_object_to_new_document(
&mut self,
object_id: ObjectId
) -> Result<()>
pub fn opt_clone_object_to_new_document( &mut self, object_id: ObjectId ) -> Result<()>
Clone Object from previous document to new document. If the object already exists nothing is done.
This function can be used to clone an object so it can be changed in the incremental updates.
sourcepub fn get_or_create_resources(
&mut self,
page_id: ObjectId
) -> Result<&mut Object>
pub fn get_or_create_resources( &mut self, page_id: ObjectId ) -> Result<&mut Object>
Get the pages resources.
Get Object that has the key Resources
.
Trait Implementations§
source§impl Clone for IncrementalDocument
impl Clone for IncrementalDocument
source§fn clone(&self) -> IncrementalDocument
fn clone(&self) -> IncrementalDocument
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for IncrementalDocument
impl Debug for IncrementalDocument
source§impl Default for IncrementalDocument
impl Default for IncrementalDocument
Auto Trait Implementations§
impl RefUnwindSafe for IncrementalDocument
impl Send for IncrementalDocument
impl Sync for IncrementalDocument
impl Unpin for IncrementalDocument
impl UnwindSafe for IncrementalDocument
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