XrefParser

class XrefParser(reader: ByteReader)

Cross-reference table + trailer parser (ISO 32000-1 §7.5).

A PDF's catalog is found by:

  1. Reading the last ~1KB of the file for "startxref OFFSET".

  2. 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).

  3. Reading the /Trailer dict (or the stream's own dict) for /Root and /Prev pointers.

  4. 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.

Constructors

Link copied to clipboard
constructor(reader: ByteReader)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard