pub struct PageObjectCtxMut<'doc> { /* private fields */ }Expand description
Mutable context for accessing page objects on a single page.
Obtained via EditDocument::page_objects_mut().
Provides both read and write access. Immutable methods delegate through an auto-reborrow so you can mix reads and writes without giving up the context.
§Example
let mut ctx = doc.page_objects_mut(0);
ctx.insert_object(new_obj).unwrap();
ctx.remove_object(0).unwrap();Implementations§
Source§impl<'doc> PageObjectCtxMut<'doc>
impl<'doc> PageObjectCtxMut<'doc>
Sourcepub fn get_object(&self, index: usize) -> Result<Vec<u8>, EditError>
pub fn get_object(&self, index: usize) -> Result<Vec<u8>, EditError>
Returns a copy of the raw content bytes for the page object at index.
ADR-019 T2 alias for FPDFPage_GetObject.
Sourcepub fn count_objects(&self) -> Result<usize, EditError>
pub fn count_objects(&self) -> Result<usize, EditError>
Returns the number of page objects on this page.
ADR-019 T2 alias for FPDFPage_CountObjects.
Sourcepub fn remove_object(&mut self, index: usize) -> Result<(), EditError>
pub fn remove_object(&mut self, index: usize) -> Result<(), EditError>
Remove the page object at index from this page’s content stream.
ADR-019 T2 alias for FPDFPage_RemoveObject. Namespaced here to
avoid collision with the FPDFAnnot_RemoveObject alias on
EditDocument.
See also AnnotObjectCtxMut::remove_object() for the annotation side.
Sourcepub fn insert_object(&mut self, object: PageObject) -> Result<(), EditError>
pub fn insert_object(&mut self, object: PageObject) -> Result<(), EditError>
Insert a page object into this page’s content stream.
ADR-019 T2 alias for FPDFPage_InsertObject.