SetaPDF_Core_Parser_CrossReferenceTable A PDF cross reference parser

File: /SetaPDF/Core/Parser/CrossReferenceTable.php

Class hierarchy

Implements

Summary

Static Properties

$fileTrailerSearchLength

The byte count in which the initial xref keyword should be searched for

$readOnAccess

If set to true, the xref table will only read/resolved if an access to an object is needed. This is very fast for a small amount of access (updates). If set to false, the complete xref-table will be read in at once. This is faster if the document should be completely rewritten.


Properties

$_compressed

Cross reference uses compressed object streams

$_compressedXrefObjects

An array holding all resolved indirect objects representing compressed xref tables.

$_maxObjId

The greatest used object id

$_objectOffsets

The cross reference content

$_parser

$_parserObjectOffsets

Object offsets in the parser File

$_pointerToXref

The initial pointer to the xref table

$_updatedOffsets

Updated offsets

$_xrefSubsection

Offset positions of subsections or cross reference stream objects


Methods

__construct()

_readTrailerAndXref()

protected void SetaPDF_Core_Parser_CrossReferenceTable::_readTrailerAndXref ( integer|boolean $xrefOffset )

Read the document trailer and initiate the initial parsing of the xref table.

Parameters
$xrefOffset : integer|boolean
 
Exceptions

Throws SetaPDF_Core_Parser_CrossReferenceTable_Exception

_readXref()

Read the xref table at a specific position.

Exceptions

Throws SetaPDF_Core_Parser_CrossReferenceTable_Exception

cleanUp()

Release memory/references.

deleteObject()

public void SetaPDF_Core_Document_CrossReferenceTable::deleteObject ( integer $objectId )

Mark an object as deleted.

Parameters
$objectId : integer
 

getCompressed()

public boolean|SetaPDF_Core_Type_Stream SetaPDF_Core_Document_CrossReferenceTable::getCompressed ( SetaPDF_Core_Type_Dictionary $value, integer $newPointerToXref [, boolean $onlyUpdated = true ] )

Get the cross reference as a compressed stream object.

Parameters
$value : SetaPDF_Core_Type_Dictionary
 
$newPointerToXref : integer
 
$onlyUpdated : boolean
 

getCompressedXrefObjects()

Get all indirect objects holding cross reference streams.

getDefinedObjectIds()

Get all defined object ids.

This method returns an array of all objects which are noticed in any cross reference table. The appearance of an object id in this list is not an evidence of existence of the desired object.

getDefiniedObjectIds()

Alias for getDefinedObjectIds()

getGenerationNumberByObjectId()

public integer|boolean SetaPDF_Core_Parser_CrossReferenceTable::getGenerationNumberByObjectId ( integer $objectId )

Get the generation number by an object id.

Parameters
$objectId : integer
 

getOffsetFor()

public integer|array|boolean SetaPDF_Core_Document_CrossReferenceTable::getOffsetFor ( integer $objectId [, integer|null $generation = 0 ] )

Get an offset for an object.

Parameters
$objectId : integer
 
$generation : integer|null
 

getParserOffsetFor()

public boolean|mixed SetaPDF_Core_Parser_CrossReferenceTable::getParserOffsetFor ( integer $objectId [, integer $generation = null [, integer &$objectGeneration = null ]] )

Returns the offset position of an object.

Parameters
$objectId : integer
 
$generation : integer
 
$objectGeneration : integer

The final generation number, resolved if no generation number was given.

getPointerToXref()

Find the initial point to the xref table.

Exceptions

Throws SetaPDF_Core_Parser_CrossReferenceTable_Exception

getSize()

Get the size of the cross reference table.

getTrailer()

Returns the trailer dictionary.

isCompressed()

Check if the xref table uses compressed xref streams.

isOffsetUpdated()

public boolean SetaPDF_Core_Document_CrossReferenceTable::isOffsetUpdated ( integer $objectId )

Checks if an objects offset is updated.

Parameters
$objectId : integer
 

setOffsetFor()

public void SetaPDF_Core_Document_CrossReferenceTable::setOffsetFor ( integer $objectId, integer $generation, integer|array $offset )

Set an object offset.

Parameters
$objectId : integer
 
$generation : integer
 
$offset : integer|array
 

updateSize()

public void SetaPDF_Core_Document_CrossReferenceTable::updateSize ( integer $objectId )

Updates the size value of this cross-reference table.

Parameters
$objectId : integer
 

writeNormal()

public integer SetaPDF_Core_Document_CrossReferenceTable::writeNormal ( SetaPDF_Core_Writer_WriterInterface $writer [, boolean $onlyUpdated = true ] )

Writes the cross reference to a writer.

Parameters
$writer : SetaPDF_Core_Writer_WriterInterface
 
$onlyUpdated : boolean