SetaPDF_Core_Parser_Content A parser for PDF content

File: /SetaPDF/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 void SetaPDF_Core_Parser_Content::cleanUp ( void )

Release memory / cycled references

getParser()

public SetaPDF_Core_Parser_RawPdf SetaPDF_Core_Parser_Content::getParser ( void )

Get the pdf parser instance for the passed content stream.

process()

public void SetaPDF_Core_Parser_Content::process ( void )

Process the stream.

registerOperator()

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

Register a callback for an operator token.

Parameters
$operator : string|array
 
$callback : callable
 

skipUntil()

public bool SetaPDF_Core_Parser_Content::skipUntil ( string $operator )

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 void SetaPDF_Core_Parser_Content::unregisterOperator ( string $operator )

Unregister an operator and its callback.

Parameters
$operator : string