pub struct Reader<'a> {
pub buffer: &'a [u8],
pub document: Document,
pub encryption_state: Option<EncryptionState>,
pub raw_objects: BTreeMap<ObjectId, Vec<u8>>,
pub password: Option<String>,
pub options: LoadOptions,
}Fields§
§buffer: &'a [u8]§document: Document§encryption_state: Option<EncryptionState>§raw_objects: BTreeMap<ObjectId, Vec<u8>>§password: Option<String>§options: LoadOptionsImplementations§
Source§impl Reader<'_>
impl Reader<'_>
Sourcepub fn read_metadata(self) -> Result<PdfMetadata>
pub fn read_metadata(self) -> Result<PdfMetadata>
Read metadata (title and page count) without loading the entire document. This is much faster for large PDFs when you only need basic information.
For encrypted PDFs, use Document::load_metadata_with_password() instead.
Sourcepub fn read(
self,
filter_func: Option<fn((u32, u16), &mut Object) -> Option<((u32, u16), Object)>>,
) -> Result<Document>
pub fn read( self, filter_func: Option<fn((u32, u16), &mut Object) -> Option<((u32, u16), Object)>>, ) -> Result<Document>
Read whole document.
pub fn get_object( &self, id: ObjectId, already_seen: &mut HashSet<ObjectId>, ) -> Result<Object>
Auto Trait Implementations§
impl<'a> Freeze for Reader<'a>
impl<'a> !RefUnwindSafe for Reader<'a>
impl<'a> Send for Reader<'a>
impl<'a> Sync for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> UnsafeUnpin for Reader<'a>
impl<'a> !UnwindSafe for Reader<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more