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: u64Total file length in bytes (/L).
primary_page: u32Primary (first) page number (/P), typically 0.
main_xref_table_first_entry_offset: u64Byte offset of the first entry in the main cross-reference table (/T).
page_count: u32Total page count (/N).
first_page_end_offset: u64Byte offset of the end of the first page’s data (/E).
first_page_obj_num: u32Object number of the first page object (/O).
last_xref_offset: u64Byte 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
impl LinearizedInfo
Sourcepub fn file_size(&self) -> u64
pub fn file_size(&self) -> u64
Returns the total file size in bytes (/L).
Corresponds to CPDF_LinearizedHeader::GetFileSize() in PDFium.
Sourcepub fn get_file_size(&self) -> u64
pub fn get_file_size(&self) -> u64
ADR-019 alias for file_size().
Corresponds to CPDF_LinearizedHeader::GetFileSize() in PDFium.
Sourcepub fn first_page_no(&self) -> u32
pub fn first_page_no(&self) -> u32
Returns the primary (first) page number (/P).
Corresponds to CPDF_LinearizedHeader::GetFirstPageNo() in PDFium.
Sourcepub fn get_first_page_no(&self) -> u32
pub fn get_first_page_no(&self) -> u32
ADR-019 alias for first_page_no().
Corresponds to CPDF_LinearizedHeader::GetFirstPageNo() in PDFium.
Sourcepub fn main_xref_table_first_entry_offset(&self) -> u64
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.
Sourcepub fn get_main_xref_table_first_entry_offset(&self) -> u64
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.
Sourcepub fn page_count(&self) -> u32
pub fn page_count(&self) -> u32
Returns the total page count (/N).
Corresponds to CPDF_LinearizedHeader::GetPageCount() in PDFium.
Sourcepub fn get_page_count(&self) -> u32
pub fn get_page_count(&self) -> u32
ADR-019 alias for page_count().
Corresponds to CPDF_LinearizedHeader::GetPageCount() in PDFium.
Sourcepub fn first_page_end_offset(&self) -> u64
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.
Sourcepub fn get_first_page_end_offset(&self) -> u64
pub fn get_first_page_end_offset(&self) -> u64
ADR-019 alias for first_page_end_offset().
Corresponds to CPDF_LinearizedHeader::GetFirstPageEndOffset() in PDFium.
Sourcepub fn first_page_obj_num(&self) -> u32
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.
Sourcepub fn get_first_page_obj_num(&self) -> u32
pub fn get_first_page_obj_num(&self) -> u32
ADR-019 alias for first_page_obj_num().
Corresponds to CPDF_LinearizedHeader::GetFirstPageObjNum() in PDFium.
Sourcepub fn last_xref_offset(&self) -> u64
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.
Sourcepub fn get_last_xref_offset(&self) -> u64
pub fn get_last_xref_offset(&self) -> u64
ADR-019 alias for last_xref_offset().
Corresponds to CPDF_LinearizedHeader::GetLastXRefOffset() in PDFium.
Sourcepub fn hint_start(&self) -> Option<u64>
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.
Sourcepub fn get_hint_start(&self) -> Option<u64>
pub fn get_hint_start(&self) -> Option<u64>
ADR-019 alias for hint_start().
Corresponds to CPDF_LinearizedHeader::GetHintStart() in PDFium.
Sourcepub fn hint_length(&self) -> Option<u32>
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.
Sourcepub fn get_hint_length(&self) -> Option<u32>
pub fn get_hint_length(&self) -> Option<u32>
ADR-019 alias for hint_length().
Corresponds to CPDF_LinearizedHeader::GetHintLength() in PDFium.
Sourcepub fn has_hint_table(&self) -> bool
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
impl Clone for LinearizedInfo
Source§fn clone(&self) -> LinearizedInfo
fn clone(&self) -> LinearizedInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more