setasign\FpdiPdfParser\PdfParser\CrossReference

CrossReference Class CrossReference

File: /FPDI PDF-Parser v2/PdfParser/CrossReference/CrossReference.php

This class also supports reading of compressed cross-references and object streams.

Class hierarchy

Summary

Static Properties

$trailerSearchLength

static public int \setasign\Fpdi\PdfParser\CrossReference\CrossReference::$trailerSearchLength = 5500

The byte length in which the "startxref" keyword should be searched.


Properties

$compressedXrefs

$fileHeaderOffset

protected int \setasign\Fpdi\PdfParser\CrossReference\CrossReference::$fileHeaderOffset = 0

$objectStreams

protected array CrossReference::$objectStreams = array()

Data of object streams.

$readers

protected \setasign\Fpdi\PdfParser\CrossReference\ReaderInterface[] \setasign\Fpdi\PdfParser\CrossReference\CrossReference::$readers = array()


Methods

__construct()

public CrossReference::__construct (
\setasign\FpdiPdfParser\PdfParser\PdfParser $parser [, int $fileHeaderOffset = 0 ]
)

CrossReference constructor.

Parameters
$parser : \setasign\FpdiPdfParser\PdfParser\PdfParser
 
$fileHeaderOffset : int
 

checkForEncryption()

protected \setasign\Fpdi\PdfParser\CrossReference\CrossReference::checkForEncryption (
\setasign\Fpdi\PdfParser\Type\PdfDictionary $dictionary
): void

Check for encryption.

Parameters
$dictionary : \setasign\Fpdi\PdfParser\Type\PdfDictionary
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

findStartXref()

protected \setasign\Fpdi\PdfParser\CrossReference\CrossReference::findStartXref (
void
): int

Find the start position for the first cross-reference.

Return Values

The byte-offset position of the first cross-reference.

Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

getIndirectObject()

public CrossReference::getIndirectObject (
int $objectNumber
): \setasign\Fpdi\PdfParser\Type\PdfIndirectObject

Get an indirect object by its object number.

Parameters
$objectNumber : int
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

getOffsetFor()

public CrossReference::getOffsetFor (
int $objectNumber
): integer|array|bool

Get the offset by an object number.

Parameters
$objectNumber : int
 

getReaders()

public \setasign\Fpdi\PdfParser\CrossReference\CrossReference::getReaders (
void
): \setasign\Fpdi\PdfParser\CrossReference\ReaderInterface[]

Get the cross reference readser instances.

getSize()

public \setasign\Fpdi\PdfParser\CrossReference\CrossReference::getSize (
void
): integer

Get the size of the cross reference.

getTrailer()

public \setasign\Fpdi\PdfParser\CrossReference\CrossReference::getTrailer (
void
): \setasign\Fpdi\PdfParser\Type\PdfDictionary

Get the trailer dictionary.

initReaderInstance()

protected CrossReference::initReaderInstance (
\setasign\Fpdi\PdfParser\Type\PdfToken|\setasign\Fpdi\PdfParser\Type\PdfIndirectObject $initValue
): \setasign\Fpdi\PdfParser\CrossReference\ReaderInterface|bool

Get a cross-reference reader instance.

Parameters
$initValue : \setasign\Fpdi\PdfParser\Type\PdfToken|\setasign\Fpdi\PdfParser\Type\PdfIndirectObject
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

readXref()

protected \setasign\Fpdi\PdfParser\CrossReference\CrossReference::readXref (
int $offset
): \setasign\Fpdi\PdfParser\CrossReference\ReaderInterface

Read the cross-reference table at a given offset.

Internally the method will try to evaluate the best reader for this cross-reference.

Parameters
$offset : int
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException