pub struct PdfTrailer {
pub dict: PdfDictionary,
pub prev: Option<u64>,
pub xref_offset: u64,
}Expand description
PDF Trailer information
Fields§
§dict: PdfDictionaryThe trailer dictionary
prev: Option<u64>Byte offset of previous xref section (if any)
xref_offset: u64Byte offset of this xref section
Implementations§
Source§impl PdfTrailer
impl PdfTrailer
Sourcepub fn from_dict(dict: PdfDictionary, xref_offset: u64) -> ParseResult<Self>
pub fn from_dict(dict: PdfDictionary, xref_offset: u64) -> ParseResult<Self>
Parse trailer from a dictionary
Sourcepub fn size(&self) -> ParseResult<u32>
pub fn size(&self) -> ParseResult<u32>
Get the size (number of entries in xref table)
Sourcepub fn root(&self) -> ParseResult<(u32, u16)>
pub fn root(&self) -> ParseResult<(u32, u16)>
Get the root object reference (document catalog)
Sourcepub fn find_root_fallback(&self) -> Option<(u32, u16)>
pub fn find_root_fallback(&self) -> Option<(u32, u16)>
Try to find root by scanning for Catalog object
Sourcepub fn info(&self) -> Option<(u32, u16)>
pub fn info(&self) -> Option<(u32, u16)>
Get the info object reference (document information dictionary)
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Check if this PDF is encrypted
Sourcepub fn encrypt(&self) -> ParseResult<Option<(u32, u16)>>
pub fn encrypt(&self) -> ParseResult<Option<(u32, u16)>>
Get the encryption dictionary reference
Sourcepub fn validate(&self) -> ParseResult<()>
pub fn validate(&self) -> ParseResult<()>
Validate the trailer dictionary
Sourcepub fn dict(&self) -> &PdfDictionary
pub fn dict(&self) -> &PdfDictionary
Get access to the trailer dictionary
Trait Implementations§
Source§impl Clone for PdfTrailer
impl Clone for PdfTrailer
Source§fn clone(&self) -> PdfTrailer
fn clone(&self) -> PdfTrailer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PdfTrailer
impl RefUnwindSafe for PdfTrailer
impl Send for PdfTrailer
impl Sync for PdfTrailer
impl Unpin for PdfTrailer
impl UnwindSafe for PdfTrailer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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