Skip to main content

Linearization

Struct Linearization 

Source
pub struct Linearization {
    pub version: f64,
    pub file_length: u64,
    pub hint_streams: Vec<(u64, u64)>,
    pub first_page_object: u32,
    pub first_page_end: u64,
    pub page_count: u32,
    pub main_xref_offset: u64,
    pub first_page: u32,
}
Expand description

The linearization parameter dictionary (ISO 32000-1 Annex F.3, Table F.1): the first object of a linearized file, whose entries locate the first page and the hint streams so a reader can show the first page before the whole file has arrived.

Fields§

§version: f64

/Linearized: the version of the linearized format.

§file_length: u64

/L: the length of the file the dictionary was written for. When it differs from the actual length the file is ordinary PDF; see Linearization::is_current.

§hint_streams: Vec<(u64, u64)>

/H: the offset and length of the primary hint stream and, when present, of the overflow hint stream, as written.

§first_page_object: u32

/O: the object number of the first page’s page object.

§first_page_end: u64

/E: the offset of the end of the first page.

§page_count: u32

/N: the number of pages in the document.

§main_xref_offset: u64

/T: the offset of the main cross-reference table’s first entry (of the main cross-reference stream in a file that uses streams).

§first_page: u32

/P: the page number of the first page, 0 when absent.

Implementations§

Source§

impl Linearization

Source

pub fn is_current(&self, file_length: u64) -> bool

Whether /L equals the file’s actual file_length. Table F.1 makes a mismatch mean the file is not linearized and shall be read as ordinary PDF, the usual cause being an appended update.

Covers ISO 32000-1 Annex F.3.

Trait Implementations§

Source§

impl Clone for Linearization

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Linearization

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Linearization

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Linearization

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, 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.