DictParser

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.

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

Methods

objectToArray()

File: DictParser.php line 80

public objectToArray(array<int, mixed> $objData) : array<int, mixed>|null

Only the first element is examined: an object holding an array opens with the array token, while a stream object can expose trailing tokens when its payload contains an “endstream” marker.

Parameters

  • $objData : array<int, mixed>: Raw object data from the parser.

Return values

array<int, mixed>|null —

Parsed array elements, or null when the object holds no array.

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

Return values

array<string, mixed>

parseDictArray()

File: DictParser.php line 102

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 135

public parseValue(mixed $raw) : mixed

Parameters

  • $raw : mixed: Raw element from the parser.

resolveArray()

File: DictParser.php line 227

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 191

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.