pub struct PdfReader<R: Read + Seek> { /* private fields */ }Expand description
High-level PDF reader
Implementations§
Source§impl PdfReader<File>
impl PdfReader<File>
Sourcepub fn open<P: AsRef<Path>>(path: P) -> ParseResult<Self>
pub fn open<P: AsRef<Path>>(path: P) -> ParseResult<Self>
Open a PDF file from a path
Sourcepub fn open_document<P: AsRef<Path>>(path: P) -> ParseResult<PdfDocument<File>>
pub fn open_document<P: AsRef<Path>>(path: P) -> ParseResult<PdfDocument<File>>
Open a PDF file as a PdfDocument
Source§impl<R: Read + Seek> PdfReader<R>
impl<R: Read + Seek> PdfReader<R>
Sourcepub fn new(reader: R) -> ParseResult<Self>
pub fn new(reader: R) -> ParseResult<Self>
Create a new PDF reader from a reader
Sourcepub fn version(&self) -> &PdfVersion
pub fn version(&self) -> &PdfVersion
Get the PDF version
Sourcepub fn catalog(&mut self) -> ParseResult<&PdfDictionary>
pub fn catalog(&mut self) -> ParseResult<&PdfDictionary>
Get the document catalog
Sourcepub fn info(&mut self) -> ParseResult<Option<&PdfDictionary>>
pub fn info(&mut self) -> ParseResult<Option<&PdfDictionary>>
Get the document info dictionary
Sourcepub fn get_object(
&mut self,
obj_num: u32,
gen_num: u16,
) -> ParseResult<&PdfObject>
pub fn get_object( &mut self, obj_num: u32, gen_num: u16, ) -> ParseResult<&PdfObject>
Get an object by reference
Sourcepub fn resolve<'a>(
&'a mut self,
obj: &'a PdfObject,
) -> ParseResult<&'a PdfObject>
pub fn resolve<'a>( &'a mut self, obj: &'a PdfObject, ) -> ParseResult<&'a PdfObject>
Resolve a reference to get the actual object
Sourcepub fn pages(&mut self) -> ParseResult<&PdfDictionary>
pub fn pages(&mut self) -> ParseResult<&PdfDictionary>
Get the page tree root
Sourcepub fn page_count(&mut self) -> ParseResult<u32>
pub fn page_count(&mut self) -> ParseResult<u32>
Get the number of pages
Sourcepub fn metadata(&mut self) -> ParseResult<DocumentMetadata>
pub fn metadata(&mut self) -> ParseResult<DocumentMetadata>
Get metadata from the document
Sourcepub fn get_page(&mut self, _index: u32) -> ParseResult<&ParsedPage>
pub fn get_page(&mut self, _index: u32) -> ParseResult<&ParsedPage>
Get a specific page by index (0-based)
Note: This method is currently not implemented due to borrow checker constraints. The page_tree needs mutable access to both itself and the reader, which requires a redesign of the architecture. Use PdfDocument instead for page access.
Sourcepub fn get_all_pages(&mut self) -> ParseResult<Vec<ParsedPage>>
pub fn get_all_pages(&mut self) -> ParseResult<Vec<ParsedPage>>
Get all pages
Sourcepub fn into_document(self) -> PdfDocument<R>
pub fn into_document(self) -> PdfDocument<R>
Convert this reader into a PdfDocument for easier page access
Auto Trait Implementations§
impl<R> Freeze for PdfReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for PdfReader<R>where
R: RefUnwindSafe,
impl<R> Send for PdfReader<R>where
R: Send,
impl<R> Sync for PdfReader<R>where
R: Sync,
impl<R> Unpin for PdfReader<R>where
R: Unpin,
impl<R> UnwindSafe for PdfReader<R>where
R: UnwindSafe,
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