pub struct Document<'a> { /* private fields */ }Expand description
An open PDF document.
Implementations§
Source§impl<'a> Document<'a>
impl<'a> Document<'a>
Sourcepub fn open_with_limits(data: &'a [u8], limits: Limits) -> Result<Document<'a>>
pub fn open_with_limits(data: &'a [u8], limits: Limits) -> Result<Document<'a>>
Open with explicit decompression limits.
Sourcepub fn xref_was_rebuilt(&self) -> bool
pub fn xref_was_rebuilt(&self) -> bool
true when the xref table could not be parsed and was rebuilt by
scanning for object headers.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
true when the trailer declares /Encrypt. Text extraction refuses
encrypted documents with Error::Unsupported-bearing errors.
Sourcepub fn encryption(&self) -> Option<Ref>
pub fn encryption(&self) -> Option<Ref>
The /Encrypt object reference, if present.
Sourcepub fn object(&self, r: Ref) -> Result<Obj>
pub fn object(&self, r: Ref) -> Result<Obj>
Resolve and parse one indirect object (public for inspection; the returned object is owned).
Sourcepub fn text(&self) -> Result<String>
pub fn text(&self) -> Result<String>
Extract the whole document’s text, pages joined by \x0c (form
feed). The first failing page aborts with Error::Page.
Auto Trait Implementations§
impl<'a> !Freeze for Document<'a>
impl<'a> !RefUnwindSafe for Document<'a>
impl<'a> !Sync for Document<'a>
impl<'a> Send for Document<'a>
impl<'a> Unpin for Document<'a>
impl<'a> UnsafeUnpin for Document<'a>
impl<'a> UnwindSafe for Document<'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