SetaPDF_Core_Parser_RawPdf A PDF parser for standard tokens.

File: /SetaPDF v2/Core/Parser/RawPdf.php

This class doesn't work with final object instances but only returns simple SetaPDF_Core_Type_Raw instances with raw extracted PDF data.

Class hierarchy

Summary

Constants

TYPE_ARRAY

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_ARRAY = 1

A PDF type constant.

TYPE_BOOLEAN

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_BOOLEAN = 2

A PDF type constant.

TYPE_DICTIONARY

A PDF type constant.

TYPE_HEX_STRING

A PDF type constant.

TYPE_NAME

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_NAME = 7

A PDF type constant.

TYPE_NULL

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_NULL = 8

A PDF type constant.

TYPE_NUMERIC

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_NUMERIC = 9

A PDF type constant.

TYPE_STRING

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_STRING = 10

A PDF type constant.

TYPE_TOKEN

public const integer SetaPDF_Core_Parser_RawPdf::TYPE_TOKEN = 11

A PDF type constant.


Properties

$_tokenizer


Methods

__construct()

_getNextToken()

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

Get the next token.

_readValue()

private SetaPDF_Core_Parser_RawPdf::_readValue (
string|null $token
): SetaPDF_Core_Type_Raw|false

Read a value based on a token.

Parameters
$token : string|null
 
Exceptions

Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException

Throws SetaPDF_Core_Exception

Throws UnexpectedValueException

cleanUp()

public SetaPDF_Core_Parser_RawPdf::cleanUp (
void
): void

Released memory and resources.

getReader()

getTokenizer()

Get the tokenizer object.

reset()

public SetaPDF_Core_Parser_RawPdf::reset (
[ integer $pos = 0 ]
): void

Reset the reader to a specific position.

Parameters
$pos : integer
 

setReader()

Set the reader object.

Parameters
$reader : SetaPDF_Core_Reader_ReaderInterface
 

skipUntilToken()

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