Table of contents
Namespace: Com\Tecnick\Pdf\Parser
Extends: Xref
File: Parser.php line 43
PHP class for parsing PDF documents.
Tags
- since: 2011-05-23
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2011-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-parser
- SuppressWarnings: (“PHPMD.ExcessiveClassComplexity”)
- phpstan-import-type: RawObjectArray from \Com\Tecnick\Pdf\Parser\Process\RawObject
- phpstan-import-type: XrefData from \Com\Tecnick\Pdf\Parser\Process\XrefStream
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
- throws: Exception
Return values
RawObjectArray»}