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

$_parser

protected SetaPDF_Core_Parser_RawPdf SetaPDF_Core_Parser_Content::$_parser

$_stack

protected array SetaPDF_Core_Parser_Content::$_stack = array()

Token stack

$_stream

protected string SetaPDF_Core_Parser_Content::$_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.

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()

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. For example an inline image can be ignored with this mehtod.

Parameters
$operator : string
 
Exceptions

Throws SetaPDF_Core_Exception

unregisterOperator()

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

Unregister an operator and its callback.

Parameters
$operator : string