PDF string parser

package Zend_Pdf
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Object constructor

__construct($source, \Zend_Pdf_ElementFactory_Interface $factory) 

Note: PHP duplicates string, which is sent by value, only of it's updated. Thus we don't need to care about overhead

Parameters

$source

$factory

\Zend_Pdf_ElementFactory_Interface

Clean up resources.

cleanUp() 

Clear current state to remove cyclic object references

Get length of source string

getLength() : integer

Returns

integer

Read inderect object from a PDF stream

getObject(integer $offset, \Zend_Pdf_Element_Reference_Context $context) : \Zend_Pdf_Element_Object

Parameters

$offset

integer

$context

\Zend_Pdf_Element_Reference_Context

Returns

\Zend_Pdf_Element_Object

Get source string

getString() : string

Returns

string

Character with code $chCode is a delimiter character

isDelimiter(integer $chCode) : boolean
Static

Parameters

$chCode

integer

Returns

boolean

Character with code $chCode is white space

isWhiteSpace(integer $chCode) : boolean
Static

Parameters

$chCode

integer

Returns

boolean

Parse integer value from a binary stream

parseIntFromStream(string $stream, integer $offset, integer $size) : integer
Static

Parameters

$stream

string

$offset

integer

$size

integer

Returns

integer

Read comment line

readComment() : string

Returns

string

Read elemental object from a PDF stream

readElement($nextLexeme = null) : \Zend_Pdf_Element

Parameters

$nextLexeme

Exceptions

\Zend_Pdf_Exception

Returns

\Zend_Pdf_Element

Returns next lexeme from a pdf stream

readLexeme() : string

Returns

string

Set current context

setContext(\Zend_Pdf_Element_Reference_Context $context) 

Parameters

$context

\Zend_Pdf_Element_Reference_Context

Skip comment

skipComment() 

Skip white space

skipWhiteSpace(boolean $skipComment = true

Parameters

$skipComment

boolean

Read array PDF object Also reads trailing ']' from a pdf stream

_readArray() : \Zend_Pdf_Element_Array

Exceptions

\Zend_Pdf_Exception

Returns

\Zend_Pdf_Element_Array

Read binary string PDF object Also reads trailing '>' from a pdf stream

_readBinaryString() : \Zend_Pdf_Element_String_Binary

Exceptions

\Zend_Pdf_Exception

Returns

\Zend_Pdf_Element_String_Binary

Read dictionary PDF object Also reads trailing '>>' from a pdf stream

_readDictionary() : \Zend_Pdf_Element_Dictionary

Exceptions

\Zend_Pdf_Exception

Returns

\Zend_Pdf_Element_Dictionary

Read numeric PDF object

_readNumeric(string $nextLexeme = null) : \Zend_Pdf_Element_Numeric

Parameters

$nextLexeme

string

Returns

\Zend_Pdf_Element_Numeric

Read reference PDF object

_readReference(string $nextLexeme = null) : \Zend_Pdf_Element_Reference

Parameters

$nextLexeme

string

Returns

\Zend_Pdf_Element_Reference

Read string PDF object Also reads trailing ')' from a pdf stream

_readString() : \Zend_Pdf_Element_String

Exceptions

\Zend_Pdf_Exception

Returns

\Zend_Pdf_Element_String

 Properties

 

Source PDF

$data : string

Default

''
 

Current position in a data

$offset : integer

Default

0
 

Current reference context

$_context : \Zend_Pdf_Element_Reference_Context

Default

null
 

Array of elements of the currently parsed object/trailer

$_elements : array

Default

array()
 

PDF objects factory.

$_objFactory : \Zend_Pdf_ElementFactory_Interface

Default

null