pdf-lite - v1.0.1
    Preparing search index...

    Manages cross-reference (xref) lookup for PDF objects. Handles both traditional xref tables and xref streams, including hybrid documents. Supports linking multiple revisions through the Prev chain.

    Index

    Constructors

    Properties

    entries: Map<number, PdfXRefStreamEntry>

    Map of object numbers to their xref entries

    The underlying xref object (either a table or stream)

    Reference to the previous xref lookup in the revision chain

    Trailer dictionary containing document metadata references

    Accessors

    Methods

    • Adds an indirect object to the xref lookup. Assigns an object number if not already set.

      Parameters

      • newObject: PdfIndirectObject

        The indirect object to add

      • Optionaloptions: { indexInStream?: number; parentObjectNumber?: number }

        Options for compressed objects

        • OptionalindexInStream?: number

          Index within the object stream

        • OptionalparentObjectNumber?: number

          Object number of the containing object stream

      Returns void

      Error if trying to add compressed object with non-zero generation number

    • Links this xref to a previous xref lookup. Copies missing trailer entries from the previous xref.

      Parameters

      Returns void

      Error if trying to set self as previous (would create circular reference) or if offsets match (would create ambiguous or invalid xref chain)