setasign\SetaPDF2\Core\Parser

RawPdf A PDF parser for standard tokens.

File: /SetaPDF v2/Core/Parser/RawPdf.php
Old class name (alias): \SetaPDF_Core_Parser_RawPdf

This class doesn't work with final object instances but only returns simple \setasign\SetaPDF2\Core\Type\PdfRaw instances with raw extracted PDF data.

Class hierarchy

Summary

Constants

TYPE_ARRAY

public const int RawPdf::TYPE_ARRAY = 1

A PDF type constant.

TYPE_BOOLEAN

public const int RawPdf::TYPE_BOOLEAN = 2

A PDF type constant.

TYPE_DICTIONARY

public const int RawPdf::TYPE_DICTIONARY = 3

A PDF type constant.

TYPE_HEX_STRING

public const int RawPdf::TYPE_HEX_STRING = 4

A PDF type constant.

TYPE_NAME

public const int RawPdf::TYPE_NAME = 7

A PDF type constant.

TYPE_NULL

public const int RawPdf::TYPE_NULL = 8

A PDF type constant.

TYPE_NUMERIC

public const int RawPdf::TYPE_NUMERIC = 9

A PDF type constant.

TYPE_STRING

public const int RawPdf::TYPE_STRING = 10

A PDF type constant.

TYPE_TOKEN

public const int RawPdf::TYPE_TOKEN = 11

A PDF type constant.


Properties

$_reader

$_tokenizer

The tokenizer


Methods

__construct()

The constructor.

Parameters
$reader : \SetaPDF_Core_Reader_ReaderInterface
 

_getNextToken()

protected RawPdf::_getNextToken (
void
): string|false

Get the next token.

_readValue()

private RawPdf::_readValue (
?string $token
): \SetaPDF_Core_Type_Raw|false

Read a value based on a token.

Parameters
$token : ?string
 
Exceptions

Throws Pdf\InvalidTokenException

Throws \setasign\SetaPDF2\Core\Exception

Throws \UnexpectedValueException

cleanUp()

public RawPdf::cleanUp (
void
): void

Released memory and resources.

getReader()

Get the reader object.

getTokenizer()

Get the tokenizer object.

readValue()

reset()

public RawPdf::reset (
int $pos = 0
): void

Reset the reader to a specific position.

Parameters
$pos : int
 

setReader()

Set the reader object.

Parameters
$reader : \SetaPDF_Core_Reader_ReaderInterface
 

skipUntilToken()

public RawPdf::skipUntilToken (
string $token,
bool $inToken = false
): bool

Skips tokens until a special token is found.

This method can be used to e.g. jump over binary inline image data.

Parameters
$token : string
 
$inToken : bool

Defines if the token should match exactly or if a strpos should be used to find the token.