CrossReference
in package
Class CrossReference
This class processes the standard cross reference of a PDF document.
Table of Contents
Properties
- $trailerSearchLength : int
- The byte length in which the "startxref" keyword should be searched.
- $fileHeaderOffset : int
- $parser : PdfParser
- $readers : array<string|int, ReaderInterface>
Methods
- __construct() : mixed
- CrossReference constructor.
- getIndirectObject() : PdfIndirectObject
- Get an indirect object by its object number.
- getOffsetFor() : int|bool
- Get the offset by an object number.
- getReaders() : array<string|int, ReaderInterface>
- Get the cross reference readser instances.
- getSize() : int
- Get the size of the cross reference.
- getTrailer() : PdfDictionary
- Get the trailer dictionary.
- checkForEncryption() : mixed
- Check for encryption.
- findStartXref() : int
- Find the start position for the first cross-reference.
- initReaderInstance() : ReaderInterface|bool
- Get a cross-reference reader instance.
- readXref() : ReaderInterface
- Read the cross-reference table at a given offset.
Properties
$trailerSearchLength
The byte length in which the "startxref" keyword should be searched.
public
static int
$trailerSearchLength
= 5500
$fileHeaderOffset
protected
int
$fileHeaderOffset
= 0
$parser
protected
PdfParser
$parser
$readers
protected
array<string|int, ReaderInterface>
$readers
= []
Methods
__construct()
CrossReference constructor.
public
__construct(PdfParser $parser[, mixed $fileHeaderOffset = 0 ]) : mixed
Parameters
- $parser : PdfParser
- $fileHeaderOffset : mixed = 0
Tags
getIndirectObject()
Get an indirect object by its object number.
public
getIndirectObject(int $objectNumber) : PdfIndirectObject
Parameters
- $objectNumber : int
Tags
Return values
PdfIndirectObjectgetOffsetFor()
Get the offset by an object number.
public
getOffsetFor(int $objectNumber) : int|bool
Parameters
- $objectNumber : int
Return values
int|boolgetReaders()
Get the cross reference readser instances.
public
getReaders() : array<string|int, ReaderInterface>
Return values
array<string|int, ReaderInterface>getSize()
Get the size of the cross reference.
public
getSize() : int
Return values
intgetTrailer()
Get the trailer dictionary.
public
getTrailer() : PdfDictionary
Return values
PdfDictionarycheckForEncryption()
Check for encryption.
protected
checkForEncryption(PdfDictionary $dictionary) : mixed
Parameters
- $dictionary : PdfDictionary
Tags
findStartXref()
Find the start position for the first cross-reference.
protected
findStartXref() : int
Tags
Return values
int —The byte-offset position of the first cross-reference.
initReaderInstance()
Get a cross-reference reader instance.
protected
initReaderInstance(PdfToken|PdfIndirectObject $initValue) : ReaderInterface|bool
Parameters
- $initValue : PdfToken|PdfIndirectObject
Tags
Return values
ReaderInterface|boolreadXref()
Read the cross-reference table at a given offset.
protected
readXref(int $offset) : ReaderInterface
Internally the method will try to evaluate the best reader for this cross-reference.
Parameters
- $offset : int