Skip to main content

LinearizedInfo

Struct LinearizedInfo 

Source
pub struct LinearizedInfo {
    pub file_length: u64,
    pub primary_page: u32,
    pub main_xref_table_first_entry_offset: u64,
    pub page_count: u32,
    pub first_page_end_offset: u64,
    pub first_page_obj_num: u32,
    pub last_xref_offset: u64,
    pub hint_stream_offset: Option<u64>,
    pub hint_stream_length: Option<u32>,
}
Expand description

Information extracted from a linearization dictionary.

Corresponds to CPDF_LinearizedHeader in PDFium.

Fields§

§file_length: u64

Total file length in bytes (/L).

§primary_page: u32

Primary (first) page number (/P), typically 0.

§main_xref_table_first_entry_offset: u64

Byte offset of the first entry in the main cross-reference table (/T).

§page_count: u32

Total page count (/N).

§first_page_end_offset: u64

Byte offset of the end of the first page’s data (/E).

§first_page_obj_num: u32

Object number of the first page object (/O).

§last_xref_offset: u64

Byte offset of the last cross-reference entry, derived from the parser position after endobj on the linearization dictionary object.

§hint_stream_offset: Option<u64>

Byte offset of the hint stream (/H array, first element).

§hint_stream_length: Option<u32>

Length of the hint stream in bytes (/H array, second element).

Implementations§

Source§

impl LinearizedInfo

Source

pub fn file_size(&self) -> u64

Returns the total file size in bytes (/L).

Corresponds to CPDF_LinearizedHeader::GetFileSize() in PDFium.

Source

pub fn get_file_size(&self) -> u64

ADR-019 alias for file_size().

Corresponds to CPDF_LinearizedHeader::GetFileSize() in PDFium.

Source

pub fn first_page_no(&self) -> u32

Returns the primary (first) page number (/P).

Corresponds to CPDF_LinearizedHeader::GetFirstPageNo() in PDFium.

Source

pub fn get_first_page_no(&self) -> u32

ADR-019 alias for first_page_no().

Corresponds to CPDF_LinearizedHeader::GetFirstPageNo() in PDFium.

Source

pub fn main_xref_table_first_entry_offset(&self) -> u64

Returns the byte offset of the first entry in the main xref table (/T).

Corresponds to CPDF_LinearizedHeader::GetMainXRefTableFirstEntryOffset() in PDFium.

Source

pub fn get_main_xref_table_first_entry_offset(&self) -> u64

ADR-019 alias for main_xref_table_first_entry_offset().

Corresponds to CPDF_LinearizedHeader::GetMainXRefTableFirstEntryOffset() in PDFium.

Source

pub fn page_count(&self) -> u32

Returns the total page count (/N).

Corresponds to CPDF_LinearizedHeader::GetPageCount() in PDFium.

Source

pub fn get_page_count(&self) -> u32

ADR-019 alias for page_count().

Corresponds to CPDF_LinearizedHeader::GetPageCount() in PDFium.

Source

pub fn first_page_end_offset(&self) -> u64

Returns the byte offset of the end of the first page’s data (/E).

Corresponds to CPDF_LinearizedHeader::GetFirstPageEndOffset() in PDFium.

Source

pub fn get_first_page_end_offset(&self) -> u64

ADR-019 alias for first_page_end_offset().

Corresponds to CPDF_LinearizedHeader::GetFirstPageEndOffset() in PDFium.

Source

pub fn first_page_obj_num(&self) -> u32

Returns the object number of the first page object (/O).

Corresponds to CPDF_LinearizedHeader::GetFirstPageObjNum() in PDFium.

Source

pub fn get_first_page_obj_num(&self) -> u32

ADR-019 alias for first_page_obj_num().

Corresponds to CPDF_LinearizedHeader::GetFirstPageObjNum() in PDFium.

Source

pub fn last_xref_offset(&self) -> u64

Returns the byte offset of the last cross-reference entry.

This is derived from the parser position immediately after the endobj keyword on the linearization dictionary object, equivalent to the szLastXRefOffset argument passed to the CPDF_LinearizedHeader constructor in PDFium.

Corresponds to CPDF_LinearizedHeader::GetLastXRefOffset() in PDFium.

Source

pub fn get_last_xref_offset(&self) -> u64

ADR-019 alias for last_xref_offset().

Corresponds to CPDF_LinearizedHeader::GetLastXRefOffset() in PDFium.

Source

pub fn hint_start(&self) -> Option<u64>

Returns the byte offset of the hint stream (/H first element).

Corresponds to CPDF_LinearizedHeader::GetHintStart() in PDFium.

Source

pub fn get_hint_start(&self) -> Option<u64>

ADR-019 alias for hint_start().

Corresponds to CPDF_LinearizedHeader::GetHintStart() in PDFium.

Source

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

Returns the length of the hint stream in bytes (/H second element).

Corresponds to CPDF_LinearizedHeader::GetHintLength() in PDFium.

Source

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

ADR-019 alias for hint_length().

Corresponds to CPDF_LinearizedHeader::GetHintLength() in PDFium.

Source

pub fn has_hint_table(&self) -> bool

Returns true if a hint table is present and valid.

A hint table is valid when: page count > 1, hint start > 0, and hint length > 0.

Corresponds to CPDF_LinearizedHeader::HasHintTable() in PDFium.

Trait Implementations§

Source§

impl Clone for LinearizedInfo

Source§

fn clone(&self) -> LinearizedInfo

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 LinearizedInfo

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