Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
CrossReference Class Reference

Class CrossReference. More...

Public Member Functions

 __construct (PdfParser $parser, $fileHeaderOffset=0)
 CrossReference constructor.
 
 getIndirectObject ($objectNumber)
 Get an indirect object by its object number.
 
 getOffsetFor ($objectNumber)
 Get the offset by an object number.
 
 getReaders ()
 Get the cross reference readser instances.
 
 getSize ()
 Get the size of the cross reference.
 
 getTrailer ()
 Get the trailer dictionary.
 

Static Public Attributes

static int $trailerSearchLength = 5500
 The byte length in which the "startxref" keyword should be searched.
 

Protected Member Functions

 checkForEncryption (PdfDictionary $dictionary)
 Check for encryption.
 
 findStartXref ()
 Find the start position for the first cross-reference.
 
 initReaderInstance ($initValue)
 Get a cross-reference reader instance.
 
 readXref ($offset)
 Read the cross-reference table at a given offset.
 

Protected Attributes

int $fileHeaderOffset = 0
 
PdfParser $parser
 
ReaderInterface[] $readers = []
 

Detailed Description

Class CrossReference.

This class processes the standard cross reference of a PDF document.

Constructor & Destructor Documentation

◆ __construct()

CrossReference::__construct ( PdfParser $parser,
$fileHeaderOffset = 0 )

CrossReference constructor.

Parameters
PdfParser$parser
Exceptions
CrossReferenceException
PdfTypeException

Member Function Documentation

◆ checkForEncryption()

CrossReference::checkForEncryption ( PdfDictionary $dictionary)
protected

Check for encryption.

Parameters
PdfDictionary$dictionary
Exceptions
CrossReferenceException

◆ findStartXref()

CrossReference::findStartXref ( )
protected

Find the start position for the first cross-reference.

Return values
intThe byte-offset position of the first cross-reference.
Exceptions
CrossReferenceException

◆ getIndirectObject()

CrossReference::getIndirectObject ( $objectNumber)

Get an indirect object by its object number.

Parameters
int$objectNumber
Return values
PdfIndirectObject
Exceptions
CrossReferenceException

◆ getOffsetFor()

CrossReference::getOffsetFor ( $objectNumber)

Get the offset by an object number.

Parameters
int$objectNumber
Return values
integer|bool

◆ getReaders()

CrossReference::getReaders ( )

Get the cross reference readser instances.

Return values
ReaderInterface[]

◆ getSize()

CrossReference::getSize ( )

Get the size of the cross reference.

Return values
integer

◆ getTrailer()

CrossReference::getTrailer ( )

Get the trailer dictionary.

Return values
PdfDictionary

◆ initReaderInstance()

CrossReference::initReaderInstance ( $initValue)
protected

Get a cross-reference reader instance.

Parameters
PdfToken | PdfIndirectObject$initValue
Return values
ReaderInterface|bool
Exceptions
CrossReferenceException
PdfTypeException

◆ readXref()

CrossReference::readXref ( $offset)
protected

Read the cross-reference table at a given offset.

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

Parameters
int$offset
Return values
ReaderInterface
Exceptions
CrossReferenceException
PdfTypeException

The documentation for this class was generated from the following file: