Parser

PHP class for parsing PDF documents.

Namespace: Com\Tecnick\Pdf\Parser

Extends: Xref

File: Parser.php line 43

PHP class for parsing PDF documents.

Tags

Constants

DEFAULT_MAX_STREAM_SIZE

File: Parser.php line 48

public mixed DEFAULT_MAX_STREAM_SIZE = 33554432

LIMIT_REFERENCE_CYCLE

File: Parser.php line 71

public mixed LIMIT_REFERENCE_CYCLE = 'reference_cycle'

LIMIT_RESOLUTION_DEPTH

File: Parser.php line 66

public mixed LIMIT_RESOLUTION_DEPTH = 'resolution_depth'

Methods

__construct()

File: Parser.php line 137

public __construct([array<string, bool|int> $cfg = [] ]) : mixed

Parameters

  • $cfg : array<string, bool|int> = []: Configuration parameters: ‘ignore_filter_errors’: if true, ignore filter decoding errors; ‘decode_streams’: if true, decode stream payloads while parsing regular indirect objects; ‘max_stream_size’: maximum size in bytes of a single decoded stream, 0 means unlimited; ‘max_resolution_depth’: maximum number of indirect object resolutions in flight at once, values below 1 are clamped to 1; ‘max_nesting_depth’: maximum nesting depth of array and dictionary objects, values below 1 are clamped to 1; ‘strict_limits’: if true, raise a LimitException as soon as a limit or a reference cycle leaves an object unresolved.

getLimitWarnings()

File: Parser.php line 909

public getLimitWarnings() : array<int, string>

The list is empty when no limit was reached, and always empty in strict mode, where the first event raises a LimitException instead.

Return values

array<int, string>

parse()

File: Parser.php line 181

public parse(string $data) : RawObjectArray>>}

Parameters

  • $data : string: PDF data to parse.

Tags

Return values

RawObjectArray»}