phpdftk API Documentation

ObjectResolver
in package

FinalYes

Lazy-loading object cache. Resolves indirect references by seeking to the xref-recorded byte offset, parsing the object, decompressing any stream data, and caching the result.

Table of Contents

Methods

__construct()  : mixed
getEntries()  : array<int, XrefEntry>
getEntry()  : XrefEntry|null
getObjectNumbers()  : array<int, int>
has()  : bool
mergeOlderEntries()  : void
Merge additional xref entries (older entries do NOT overwrite newer ones — newer entries from later xref sections take precedence). Used for `/Prev` chain following.
readRaw()  : string
Read a window of raw bytes from the source. Used by the reader's catalog-recovery code to peek at object bodies.
resolve()  : Serializable
resolveReference()  : Serializable
scanObjectMap()  : array<int, int>
Scan the file once and return the discovered object map. Used by the reader to find catalogs / pages roots when the trailer /Root cannot be resolved.
setStrict()  : void
Configure whether the resolver should attempt to recover from corrupted xref entries (lenient mode = false).

Methods

getObjectNumbers()

public getObjectNumbers() : array<int, int>
Return values
array<int, int>

has()

public has(int $objNum) : bool
Parameters
$objNum : int
Return values
bool

mergeOlderEntries()

Merge additional xref entries (older entries do NOT overwrite newer ones — newer entries from later xref sections take precedence). Used for `/Prev` chain following.

public mergeOlderEntries(array<int, XrefEntry$olderEntries) : void
Parameters
$olderEntries : array<int, XrefEntry>

readRaw()

Read a window of raw bytes from the source. Used by the reader's catalog-recovery code to peek at object bodies.

public readRaw(int $offset, int $length) : string
Parameters
$offset : int
$length : int
Return values
string

scanObjectMap()

Scan the file once and return the discovered object map. Used by the reader to find catalogs / pages roots when the trailer /Root cannot be resolved.

public scanObjectMap() : array<int, int>
Return values
array<int, int>

setStrict()

Configure whether the resolver should attempt to recover from corrupted xref entries (lenient mode = false).

public setStrict(bool $strict) : void
Parameters
$strict : bool

        
On this page

Search results