ObjectParser
in package
Pdf extract object parser class
Tags
Table of Contents
Constants
- MAX_DEPTH = 64
- Maximum array/dict nesting depth
Properties
- $tokenizer : Tokenizer
- Tokenizer feeding this parser
Methods
- __construct() : mixed
- Constructor
- parseValue() : mixed
- Parse the next value from the tokenizer
- isEndstreamAt() : bool
- Determine if the 'endstream' keyword appears at (or after whitespace from) a position
- parseArray() : array<string|int, mixed>
- Parse an array
- parseDictOrStream() : mixed
- Parse a dictionary, or a stream if the dictionary is followed by 'stream'
- parseNumberOrReference() : int|float|Reference
- Parse a number, disambiguating a plain number from an "N G R" indirect reference
- parseStreamData() : Stream
- Parse the raw bytes of a stream, honoring /Length when trustworthy
- parseValueFromToken() : mixed
- Parse a value from an already-read token
Constants
MAX_DEPTH
Maximum array/dict nesting depth
protected
mixed
MAX_DEPTH
= 64
Properties
$tokenizer
Tokenizer feeding this parser
protected
Tokenizer
$tokenizer
Methods
__construct()
Constructor
public
__construct(Tokenizer $tokenizer) : mixed
Instantiate an object parser.
Parameters
- $tokenizer : Tokenizer
parseValue()
Parse the next value from the tokenizer
public
parseValue() : mixed
Tags
isEndstreamAt()
Determine if the 'endstream' keyword appears at (or after whitespace from) a position
protected
isEndstreamAt(string $data, int $pos) : bool
Parameters
- $data : string
- $pos : int
Return values
boolparseArray()
Parse an array
protected
parseArray(int $depth) : array<string|int, mixed>
Parameters
- $depth : int
Tags
Return values
array<string|int, mixed>parseDictOrStream()
Parse a dictionary, or a stream if the dictionary is followed by 'stream'
protected
parseDictOrStream(int $depth) : mixed
Parameters
- $depth : int
Tags
parseNumberOrReference()
Parse a number, disambiguating a plain number from an "N G R" indirect reference
protected
parseNumberOrReference(int|float $number) : int|float|Reference
Parameters
- $number : int|float
Return values
int|float|ReferenceparseStreamData()
Parse the raw bytes of a stream, honoring /Length when trustworthy
protected
parseStreamData(array<string|int, mixed> $dict) : Stream
Parameters
- $dict : array<string|int, mixed>
Tags
Return values
StreamparseValueFromToken()
Parse a value from an already-read token
protected
parseValueFromToken(array<string|int, mixed> $token, int $depth) : mixed
Parameters
- $token : array<string|int, mixed>
- $depth : int