SetaPDF_Core_Parser_Pdf A PDF parser

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

Class hierarchy

Summary

Properties

$_currentObject

The current object which is parsed

$_owner

The owner document

$_passOwningObjectToChilds

If set to true the owning object is passed to parsed child elements

This is needed to create a relation between a parsed object and its owning element. The complete chain will be able to get a relation to the owning document. Needed for example for handling en- and decryption of strings or streams.

$_tokenizer


Methods

__construct()

_ensureExpectedValue()

private SetaPDF_Core_Parser_Pdf::_ensureExpectedValue (
string $token, string|null $expectedType
): true

Ensures that the token will evaluate to an expected object type (or not).

Parameters
$token : string
 
$expectedType : string|null
 
Exceptions

Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException

_getNextToken()

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

Get the next token.

_readValue()

private SetaPDF_Core_Parser_Pdf::_readValue (
string|null $token [, string|null $expectedType = null ]
): SetaPDF_Core_Type_AbstractType|false

Read a value based on a token.

Parameters
$token : string|null
 
$expectedType : string|null
 
Exceptions

Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException

Throws SetaPDF_Core_Exception

Throws UnexpectedValueException

cleanUp()

public SetaPDF_Core_Parser_Pdf::cleanUp (
void
): void

Released memory and resources.

getOwner()

Get the owner pdf document.

getPdfVersion()

public SetaPDF_Core_Parser_Pdf::getPdfVersion (
void
): string

Get the PDF version.

Exceptions

Throws SetaPDF_Core_Parser_Exception

getReader()

getTokenizer()

Get the tokenizer object.

readValue()

public SetaPDF_Core_Parser_Pdf::readValue (
[ string|null $expectedType = null ]
): SetaPDF_Core_Type_AbstractType|false

Read a value.

Parameters
$expectedType : string|null
 
Exceptions

Throws SetaPDF_Core_Exception

Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException

reset()

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

Reset the reader to a specific position.

Parameters
$pos : integer
 

setOwner()

Set the owner pdf document.

Parameters
$owner : SetaPDF_Core_Type_Owner
 

setPassOwningObjectToChilds()

public SetaPDF_Core_Parser_Pdf::setPassOwningObjectToChilds (
[ boolean $passOwningObjectToChilds = true ]
): void

Define if the owning object should be passed to it's childs.

Parameters
$passOwningObjectToChilds : boolean
 
See
  • $_passOwningObjectToChilds

setReader()

Set the reader object.

Parameters
$reader : SetaPDF_Core_Reader_ReaderInterface
 

skipUntilToken()

public SetaPDF_Core_Parser_Pdf::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.