Skip to main content

TrailerInfo

Struct TrailerInfo 

Source
pub struct TrailerInfo {
    pub root: ObjectId,
    pub info: Option<ObjectId>,
    pub encrypt: Option<ObjectId>,
    pub id: Option<[Vec<u8>; 2]>,
    pub size: u32,
    pub prev: Option<u64>,
}
Expand description

Extracted information from the trailer dictionary.

Fields§

§root: ObjectId

The indirect reference to the document catalog (/Root).

§info: Option<ObjectId>

Optional indirect reference to the document information dictionary (/Info).

§encrypt: Option<ObjectId>

Optional indirect reference to the encryption dictionary (/Encrypt).

§id: Option<[Vec<u8>; 2]>

Optional file identifier array (/ID).

§size: u32

Total number of cross-reference entries (/Size).

§prev: Option<u64>

Optional offset to the previous cross-reference section (/Prev).

Implementations§

Source§

impl TrailerInfo

Source

pub fn root_obj_num(&self) -> u32

Returns the object number of the document catalog (/Root).

Corresponds to CPDF_Parser::GetRootObjNum() in PDFium.

Source

pub fn get_root_obj_num(&self) -> u32

ADR-019 alias for root_obj_num().

Corresponds to CPDF_Parser::GetRootObjNum() in PDFium.

Source

pub fn info_obj_num(&self) -> Option<u32>

Returns the object number of the document information dictionary (/Info), or None if not present.

Corresponds to CPDF_Parser::GetInfoObjNum() in PDFium.

Source

pub fn get_info_obj_num(&self) -> Option<u32>

ADR-019 alias for info_obj_num().

Corresponds to CPDF_Parser::GetInfoObjNum() in PDFium.

Source

pub fn encrypt_dict(&self) -> Option<ObjectId>

Returns the object ID reference to the encryption dictionary (/Encrypt), or None if the document is not encrypted.

Corresponds to CPDF_Parser::GetEncryptDict() in PDFium (returns the reference rather than resolving the dictionary itself).

Source

pub fn get_encrypt_dict(&self) -> Option<ObjectId>

ADR-019 alias for encrypt_dict().

Corresponds to CPDF_Parser::GetEncryptDict() in PDFium.

Source

pub fn get_encrypt_id(&self) -> Option<ObjectId>

👎Deprecated:

use get_encrypt_dict() — matches upstream CPDF_Parser::GetEncryptDict()

Deprecated non-upstream alias for encrypt_dict().

There is no CPDF_Trailer::GetEncryptId() in PDFium upstream; the correct upstream method is CPDF_Parser::GetEncryptDict(), already covered by get_encrypt_dict(). Use get_encrypt_dict() instead.

Source

pub fn encrypt_id(&self) -> Option<ObjectId>

👎Deprecated since 0.0.0:

use encrypt_dict() or get_encrypt_dict()

Rust-idiomatic alias for encrypt_dict().

Source

pub fn id_array(&self) -> Option<&[Vec<u8>; 2]>

Returns a reference to the file identifier byte-string pair (/ID), or None if not present.

Corresponds to CPDF_Parser::GetIDArray() in PDFium.

Source

pub fn get_id_array(&self) -> Option<&[Vec<u8>; 2]>

ADR-019 alias for id_array().

Corresponds to CPDF_Parser::GetIDArray() in PDFium.

Trait Implementations§

Source§

impl Clone for TrailerInfo

Source§

fn clone(&self) -> TrailerInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TrailerInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more