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

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 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.