setasign\SetaPDF2\Core\Parser

Content A parser for PDF content

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

Class hierarchy

Summary

Properties

$_operators

protected array Content::$_operators = array()

Registered operators and their callbacks

$_stack

protected array Content::$_stack = array()

Token stack

$_stream

protected string Content::$_stream

The stream to parse


Methods

__construct()

public Content::__construct (
string $stream
)

The constructor.

Parameters
$stream : string
 

cleanUp()

public Content::cleanUp (
void
): void

Release memory / cycled references

getParser()

Get the pdf parser instance for the passed content stream.

process()

public Content::process (
void
): void

Process the stream.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

Throws Pdf\InvalidTokenException

registerOperator()

public 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 Content::skipUntil (
string $operator
): bool

Processes the stream until a specific operator is matched.

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

Parameters
$operator : string
 

unregisterOperator()

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

Unregister an operator and its callback.

Parameters
$operator : string