setasign\SetaPDF2\Core\Parser\CrossReferenceTable

CorruptedCrossReferenceTable A PDF cross reference parser for corrupted pdfs

File: /SetaPDF v2/Core/Parser/CrossReferenceTable/CorruptedCrossReferenceTable.php
Old class name (alias): \SetaPDF_Core_Parser_CorruptedCrossReferenceTable

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

$_parser

$_parserObjectOffsets

Object offsets in the parser File

$_pointerToXref

The pointer to the last written xref table

$_trailer

$_updatedOffsets


Methods

_extractObjectIds()

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

Extracts object ids and their offsets from a buffer.

Parameters
$buffer : string
 
$start : int
 

_extractTrailers()

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

Extracts trailer information from a buffer.

Parameters
$buffer : string
 
$start : int
 
Exceptions

Throws \setasign\SetaPDF2\Core\Exception

_matchKeywords()

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

Extracts offsets for specific keywords from a buffer.

Parameters
$buffer : string
 
$start : int
 

_screen()

protected CorruptedCrossReferenceTable::_screen (
void
): void

Screens the file for objects and keywords.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

cleanUp()

Release memory and cycled references.

deleteObject()

Mark an object as deleted.

Parameters
$objectId : int
 

ensureTrailer()

Ensures that a trailer dictionary exists or is created.

Exceptions

Throws Exception

Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getCompressedStream()

Get the cross-reference as a compressed stream object.

Parameters
$value : \SetaPDF_Core_Type_Dictionary
 
$newPointerToXref : int
 
$onlyUpdated : bool
 

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 : int
 
Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

getOffsetFor()

public \setasign\SetaPDF2\Core\Document\CrossReferenceTable::getOffsetFor (
int $objectId,
?int $generation = 0
): int|array|bool

Get an offset for an object.

Parameters
$objectId : int
 
$generation : ?int
 

getParserOffsetFor()

public CorruptedCrossReferenceTable::getParserOffsetFor (
int $objectId,
?int $generation = null,
int &$objectGeneration = null
): false|array

Returns the offset position for a specific object.

Parameters
$objectId : int
 
$generation : ?int
 
$objectGeneration : int

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

Returns the trailer dictionary.

isCompressed()

Check if the xref table uses compressed xref streams.

isOffsetUpdated()

Checks if an objects offset is updated.

Parameters
$objectId : int
 

offsetsUpdated()

Checks whether any offset was updated or not.

setOffsetFor()

public \setasign\SetaPDF2\Core\Document\CrossReferenceTable::setOffsetFor (
int $objectId,
int $generation,
int|array $offset
): void

Set an object offset.

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

updateSize()

Updates the size value of this cross-reference table.

Parameters
$objectId : int
 

writeNormal()

Writes the cross-reference to a writer.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface
 
$onlyUpdated : bool