pub struct XRefStream {
pub dict: PdfDictionary,
pub data: Vec<u8>,
pub widths: Vec<usize>,
pub index: Vec<(u32, u32)>,
}Expand description
Cross-reference stream parser
Fields§
§dict: PdfDictionaryStream dictionary
data: Vec<u8>Decoded stream data
widths: Vec<usize>Field widths from W array
index: Vec<(u32, u32)>Index array (pairs of [first_object_number, count])
Implementations§
Source§impl XRefStream
impl XRefStream
Sourcepub fn parse<R: Read + Seek>(
_reader: &mut R,
stream_dict: PdfDictionary,
stream_data: Vec<u8>,
_options: &ParseOptions,
) -> ParseResult<Self>
pub fn parse<R: Read + Seek>( _reader: &mut R, stream_dict: PdfDictionary, stream_data: Vec<u8>, _options: &ParseOptions, ) -> ParseResult<Self>
Parse a cross-reference stream from already-decoded entry bytes.
stream_data must be the decoded (decompressed) content: the caller is
responsible for running stream.decode() before invoking this function.
The stream_dict may still carry /Filter and /DecodeParms, but this
function does NOT apply them. Passing raw compressed bytes here would
re-inflate already-inflated data and produce a bogus “Xref stream data
truncated” error (issue #341).
Sourcepub fn to_xref_entries(&self) -> ParseResult<Vec<(u32, XRefEntry)>>
pub fn to_xref_entries(&self) -> ParseResult<Vec<(u32, XRefEntry)>>
Convert the cross-reference stream to XRefTable entries
Sourcepub fn trailer_dict(&self) -> &PdfDictionary
pub fn trailer_dict(&self) -> &PdfDictionary
Get the trailer dictionary from the xref stream
Sourcepub fn get_xref_stm_offset(&self) -> Option<u64>
pub fn get_xref_stm_offset(&self) -> Option<u64>
Get the offset to additional xref stream (for hybrid files)
Sourcepub fn get_prev_offset(&self) -> Option<u64>
pub fn get_prev_offset(&self) -> Option<u64>
Get the previous xref offset