SetaPDF_Core_Parser_Content A parser for PDF content

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

Class hierarchy

Summary

Properties

$_operators

protected array SetaPDF_Core_Parser_Content::$_operators = array()

Registered operators and their callbacks

$_stack

protected array SetaPDF_Core_Parser_Content::$_stack = array()

Token stack

$_stream

The stream to parse


Methods

__construct()

public SetaPDF_Core_Parser_Content::__construct (
string $stream
)

The constructor.

Parameters
$stream : string
 

cleanUp()

public SetaPDF_Core_Parser_Content::cleanUp (
void
): void

Release memory / cycled references

getParser()

Get the pdf parser instance for the passed content stream.

process()

public SetaPDF_Core_Parser_Content::process (
void
): void

Process the stream.

Exceptions

Throws SetaPDF_Core_Exception

Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException

registerOperator()

public SetaPDF_Core_Parser_Content::registerOperator (
string|array $operator, callable $callback
): void

Register a callback for an operator token.

Parameters
$operator : string|array
 
$callback : callable
 

skipUntil()

WARNING: This method is marked as deprecated!

public SetaPDF_Core_Parser_Content::skipUntil (
string $operator
): bool

Processes the stream until a specifc oprator is matched.

This method can be used to disable the process method for a specific token range.

Parameters
$operator : string
 

unregisterOperator()

public SetaPDF_Core_Parser_Content::unregisterOperator (
string $operator
): void

Unregister an operator and its callback.

Parameters
$operator : string