ObjectGraphReader
in package
Pdf build import object graph reader class
Reads one source PDF via Extract\Document, densely renumbers every object under a given starting offset, rewrites indirect references throughout, and translates the result into Build\PdfObject instances - the same shapes Document::importObjects()/Page::importPageObject()/Build\Compiler already consume. Used identically by Build\Parser (one source, offset 0) and Build\Merger (N sources, increasing offsets).
Tags
Table of Contents
Constants
- MAX_TREE_DEPTH = 64
- Maximum page-tree recursion depth
Methods
- read() : array<string|int, mixed>
- Read and translate one source document's entire object graph
- asReferenceList() : array<string|int, mixed>
- Normalize a /Contents or /Annots value into a flat list of References
- translateGeneric() : StreamObject
- Translate any non-page, non-Root, non-Info, non-top-Pages object into a generic passthrough
- translatePage() : PageObject
- Translate a leaf Page node into a fully-populated PageObject
- walkPagesTree() : void
- Recursively walk one page-tree node, accumulating inherited attributes and recording every leaf Page's object number in document order
Constants
MAX_TREE_DEPTH
Maximum page-tree recursion depth
protected
mixed
MAX_TREE_DEPTH
= 64
Methods
read()
Read and translate one source document's entire object graph
public
static read(Document $doc, int $offset) : array<string|int, mixed>
Parameters
- $doc : Document
- $offset : int
Tags
Return values
array<string|int, mixed>asReferenceList()
Normalize a /Contents or /Annots value into a flat list of References
protected
static asReferenceList(mixed $value) : array<string|int, mixed>
Parameters
- $value : mixed
Return values
array<string|int, mixed>translateGeneric()
Translate any non-page, non-Root, non-Info, non-top-Pages object into a generic passthrough
protected
static translateGeneric(int $newObjNum, mixed $rewritten) : StreamObject
Parameters
- $newObjNum : int
- $rewritten : mixed
Return values
StreamObjecttranslatePage()
Translate a leaf Page node into a fully-populated PageObject
protected
static translatePage(Document $doc, int $newObjNum, array<string|int, mixed> $node, array<string|int, mixed> $inherited, array<string|int, mixed> $map) : PageObject
Parameters
- $doc : Document
- $newObjNum : int
- $node : array<string|int, mixed>
- $inherited : array<string|int, mixed>
- $map : array<string|int, mixed>
Return values
PageObjectwalkPagesTree()
Recursively walk one page-tree node, accumulating inherited attributes and recording every leaf Page's object number in document order
protected
static walkPagesTree(Document $doc, int $objNum, array<string|int, mixed> $inherited, array<string|int, mixed> &$leafPageObjNums, array<string|int, mixed> &$inheritedByPage, array<string|int, mixed> &$visited, int $depth) : void
Parameters
- $doc : Document
- $objNum : int
- $inherited : array<string|int, mixed>
- $leafPageObjNums : array<string|int, mixed>
- $inheritedByPage : array<string|int, mixed>
- $visited : array<string|int, mixed>
- $depth : int