Table of contents
Namespace: Com\Tecnick\Pdf\Import
Final: Yes
File: DictParser.php line 38
Converts the raw object arrays returned by the PDF parser into PHP associative arrays. Indirect references are left as their raw string values for lazy resolution by the caller.
Tags
- since: 2026-08-31
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2002-2026 Nicola Asuni - Tecnick.com LTD
- license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
- link: https://github.com/tecnickcom/tc-lib-pdf
- phpstan-import-type: RawObjectArray from \Com\Tecnick\Pdf\Parser\Process\RawObject
Methods
objectToDict()
File: DictParser.php line 51
public objectToDict(array<int, mixed> $objData) : array<string, mixed>
The first element of the object array whose type is “«” (dictionary) is extracted.
Parameters
- $objData : array<int, mixed>: Raw object data from the parser.
Tags
- throws: ImportCorruptedSourceException If no dictionary element is found.
Return values
array<string, mixed>
parseDictArray()
File: DictParser.php line 77
public parseDictArray(array<int, mixed> $raw) : array<string, mixed>
Each entry in the raw array is a pair [key_element, value_element].
Parameters
- $raw : array<int, mixed>: Raw dictionary pairs from the parser.
Return values
array<string, mixed>
parseValue()
File: DictParser.php line 110
public parseValue(mixed $raw) : mixed
Parameters
- $raw : mixed: Raw element from the parser.
resolveArray()
File: DictParser.php line 202
public resolveArray(mixed $value, SourceDocument $src) : array<int, mixed>
Parameters
- $value : mixed: Raw value from a parsed dictionary.
- $src : SourceDocument : Source document the reference belongs to.
Return values
array<int, mixed> —
The array items, or an empty array when it cannot be resolved.
resolveDict()
File: DictParser.php line 166
public resolveDict(mixed $value, SourceDocument $src) : array<string, mixed>
Parameters
- $value : mixed: Raw value from a parsed dictionary.
- $src : SourceDocument : Source document the reference belongs to.
Return values
array<string, mixed> —
The dictionary, or an empty array when it cannot be resolved.