pub struct PdfReader { /* private fields */ }Expand description
Reads an existing PDF file.
PdfReader parses the PDF’s cross-reference table and trailer to locate
and resolve objects. The raw bytes and xref offset map are retained so that
future enhancements (editing, field extraction, merging) can resolve
arbitrary objects without re-reading the file.
§Limitations
PDF 1.5+ cross-reference streams are not supported. Files that use them
return PdfReadError::XrefStreamNotSupported.
Implementations§
Source§impl PdfReader
impl PdfReader
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, PdfReadError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, PdfReadError>
Open a PDF from a file path.
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<Self, PdfReadError>
pub fn from_bytes(data: Vec<u8>) -> Result<Self, PdfReadError>
Parse a PDF from raw bytes.
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Number of pages in the document.
Sourcepub fn pdf_version(&self) -> &str
pub fn pdf_version(&self) -> &str
PDF version string (e.g. "1.7").
Auto Trait Implementations§
impl Freeze for PdfReader
impl RefUnwindSafe for PdfReader
impl Send for PdfReader
impl Sync for PdfReader
impl Unpin for PdfReader
impl UnsafeUnpin for PdfReader
impl UnwindSafe for PdfReader
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