SetaPDF_Core_Parser_CorruptedCrossReferenceTable A PDF cross reference parser for corrupted pdfs

File: /SetaPDF v2/Core/Parser/CorruptedCrossReferenceTable.php

Class hierarchy

Implements

Summary

Properties

$_lastObjectOffset

The offset of the last found object

$_matchedPositions

$_maxObjId

The greatest used object id

$_objectOffsets

The cross-reference content

$_parserObjectOffsets

Object offsets in the parser File

$_pointerToXref

The pointer to the last written xref table

$_updatedOffsets

Updated offsets


Methods

_extractObjectIds()

protected SetaPDF_Core_Parser_CorruptedCrossReferenceTable::_extractObjectIds (
string $buffer, int $start
): int

Extracts object ids and their offsets from a buffer.

Parameters
$buffer : string
 
$start : int
 

_extractTrailers()

protected SetaPDF_Core_Parser_CorruptedCrossReferenceTable::_extractTrailers (
string $buffer, int $start
): void

Extracts trailer information from a buffer.

Parameters
$buffer : string
 
$start : int
 
Exceptions

Throws SetaPDF_Core_Exception

_matchKeywords()

protected SetaPDF_Core_Parser_CorruptedCrossReferenceTable::_matchKeywords (
string $buffer, int $start
): void

Extracts offsets for specific keywords from a buffer.

Parameters
$buffer : string
 
$start : int
 

_screen()

Screens the file for objects and keywords.

Exceptions

Throws SetaPDF_Core_Exception

cleanUp()

Release memory and cycled references.

deleteObject()

public SetaPDF_Core_Document_CrossReferenceTable::deleteObject (
integer $objectId
): void

Mark an object as deleted.

Parameters
$objectId : integer
 

ensureTrailer()

getCompressedStream()

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

Get the cross-reference as a compressed stream object.

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

getDefinedObjectIds()

Get all defined object ids.

getDefiniedObjectIds()

WARNING: This method is marked as deprecated!

Alias for getDefinedObjectIds()

getGenerationNumberByObjectId()

Get the generation number by an object id.

Parameters
$objectId : integer
 
Exceptions

Throws SetaPDF_Core_Type_Exception

getOffsetFor()

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

Get an offset for an object.

Parameters
$objectId : integer
 
$generation : integer|null
 

getParserOffsetFor()

public SetaPDF_Core_Parser_CorruptedCrossReferenceTable::getParserOffsetFor (
int $objectId [, int|null $generation = null [, integer &$objectGeneration = null ]]
): false|array

Returns the offset position for a specific object.

Parameters
$objectId : int
 
$generation : int|null
 
$objectGeneration : integer

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

getPointerToXref()

Returns the offset of the last written xref table.

getSize()

Get the size of the cross-reference table.

getTrailer()

isCompressed()

Check if the xref table uses compressed xref streams.

isOffsetUpdated()

public SetaPDF_Core_Document_CrossReferenceTable::isOffsetUpdated (
integer $objectId
): boolean

Checks if an objects offset is updated.

Parameters
$objectId : integer
 

offsetsUpdated()

Checks whether any offset was updated or not.

setOffsetFor()

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

Set an object offset.

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

updateSize()

public SetaPDF_Core_Document_CrossReferenceTable::updateSize (
integer $objectId
): void

Updates the size value of this cross-reference table.

Parameters
$objectId : integer
 

writeNormal()

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

Writes the cross-reference to a writer.

Parameters
$writer : SetaPDF_Core_Writer_WriterInterface
 
$onlyUpdated : boolean