XrefParser
Cross-reference table + trailer parser (ISO 32000-1 §7.5).
A PDF's catalog is found by:
Reading the last ~1KB of the file for "startxref OFFSET".
Seeking to OFFSET, which is either:
a classic "xref" table (textual, PDF 1.0-1.4 style), or
a "cross-reference stream" object (PDF 1.5+, more compact).
Reading the /Trailer dict (or the stream's own dict) for /Root and /Prev pointers.
Following /Prev to chain through any update sections.
Classic xref tables are fully supported. Xref streams are parsed as a regular stream object and walked, but only Type-1 (uncompressed in-file) and Type-2 (compressed inside an object stream) entries are decoded. Type-0 (free) entries are recognized but skipped.