SetaPDF_Core_Parser_CorruptedCrossReferenceTable A PDF cross reference parser for corrupted pdfs

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

Class hierarchy

Implements

Summary

Properties

$_matchedPositions

protected null SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_matchedPositions = array(...)

$_maxObjId

protected integer SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_maxObjId = 0

The greatest used object id

$_objectOffsets

protected array SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_objectOffsets = array(...)

The cross reference content

$_parser

protected SetaPDF_Core_Parser_Pdf SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_parser

The PDF parser instance

$_parserObjectOffsets

protected array SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_parserObjectOffsets = array()

Object offsets in the parser File

$_pointerToXref

protected integer SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_pointerToXref

The pointer to the last written xref table

$_trailer

protected SetaPDF_Core_Type_Dictionary SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_trailer

The trailer dictionary

$_updatedOffsets

protected array SetaPDF_Core_Parser_CorruptedCrossReferenceTable::$_updatedOffsets = array()

Updated offsets


Methods

_extractObjectIds()

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

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
 

_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.

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

Ensures that a trailer dictionary exists or is created.

Exceptions

Throws SetaPDF_Core_Parser_CrossReferenceTable_Exception

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

Alias for getDefinedObjectIds()

getGenerationNumberByObjectId()

Get the generation number by an object id.

Parameters
$objectId : integer
 

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 ]
): bool|int

Returns the offset position for a specific object.

Parameters
$objectId : int
 
$generation : int|null
 

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
 

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