pub struct PDFDocument { /* private fields */ }Expand description
Represents a PDF document with all its components and functionality.
This struct encapsulates a parsed PDF document, providing access to its cross-reference table, version information, tokenizer, and page structure.
Implementations§
Source§impl PDFDocument
impl PDFDocument
Sourcepub fn open(path: PathBuf) -> Result<PDFDocument>
pub fn open(path: PathBuf) -> Result<PDFDocument>
Sourcepub fn new(sequence: impl Sequence + 'static) -> Result<PDFDocument>
pub fn new(sequence: impl Sequence + 'static) -> Result<PDFDocument>
Creates a PDF document from a sequence of bytes.
This function parses a sequence of bytes representing a PDF document and constructs a PDFDocument instance with all its components.
§Arguments
sequence- A sequence implementation providing access to the PDF bytes
§Returns
A Result containing the parsed PDFDocument or an error if parsing fails
Sourcepub fn get_xref_slice(&self) -> &[XEntry]
pub fn get_xref_slice(&self) -> &[XEntry]
Gets a reference to the cross-reference table slice.
§Returns
A slice reference to the vector of cross-reference entries
Sourcepub fn find_xref_index<F>(&self, visit: F) -> Option<usize>
pub fn find_xref_index<F>(&self, visit: F) -> Option<usize>
Sourcepub fn get_version(&self) -> &PDFVersion
pub fn get_version(&self) -> &PDFVersion
Gets the PDF version information.
§Returns
A reference to the PDFVersion struct containing version information
pub fn read_object_with_ref( &mut self, tuple: ObjRefTuple, ) -> Result<Option<PDFObject>>
pub fn get_page_num(&self) -> usize
pub fn get_page_ids(&self) -> Vec<u64>
pub fn get_page(&self, node_id: u64) -> Option<&PageNode>
Auto Trait Implementations§
impl Freeze for PDFDocument
impl !RefUnwindSafe for PDFDocument
impl !Send for PDFDocument
impl !Sync for PDFDocument
impl Unpin for PDFDocument
impl !UnwindSafe for PDFDocument
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