Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
FixedReader Class Reference

Class FixedReader. More...

Inheritance diagram for FixedReader:
AbstractReader ReaderInterface

Public Member Functions

 __construct (PdfParser $parser)
 FixedReader constructor.
 
 fixFaultySubSectionShift ()
 Fixes an invalid object number shift.
 
 getOffsetFor ($objectNumber)
 Get an offset by an object number.
Parameters
int$objectNumber
Return values
int|boolFalse if the offset was not found.

 
 getSubSections ()
 Get all subsection data.
 
 getTrailer ()
 Get the trailer dictionary.
 
 getTrailer ()
 Get the trailer related to this cross reference.
 

Protected Member Functions

 read ()
 Read the cross-reference.
 
 readTrailer ()
 Read the trailer dictionary.
 

Protected Attributes

PdfParser $parser
 
StreamReader $reader
 
array $subSections
 Data of subsections.
 
PdfDictionary $trailer
 

Detailed Description

Class FixedReader.

This reader allows a very less overhead parsing of single entries of the cross-reference, because the main entries are only read when needed and not in a single run.

Constructor & Destructor Documentation

◆ __construct()

FixedReader::__construct ( PdfParser $parser)

FixedReader constructor.

Parameters
PdfParser$parser
Exceptions
CrossReferenceException

Reimplemented from AbstractReader.

Member Function Documentation

◆ fixFaultySubSectionShift()

FixedReader::fixFaultySubSectionShift ( )

Fixes an invalid object number shift.

This method can be used to repair documents with an invalid subsection header:

xref 1 7 0000000000 65535 f 0000000009 00000 n 0000412075 00000 n 0000412172 00000 n 0000412359 00000 n 0000412417 00000 n 0000412468 00000 n

It shall only be called on the first table.

Return values
bool

◆ getOffsetFor()

FixedReader::getOffsetFor ( $objectNumber)

Get an offset by an object number.

Parameters
int$objectNumber
Return values
int|boolFalse if the offset was not found.

Return values
int|false

Implements ReaderInterface.

◆ getSubSections()

FixedReader::getSubSections ( )

Get all subsection data.

Return values
array

◆ getTrailer() [1/2]

AbstractReader::getTrailer ( )
inherited

Get the trailer dictionary.

Return values
PdfDictionary

◆ getTrailer() [2/2]

ReaderInterface::getTrailer ( )
inherited

Get the trailer related to this cross reference.

Return values
PdfDictionary

◆ read()

FixedReader::read ( )
protected

Read the cross-reference.

This reader will only read the subsections in this method. The offsets were resolved individually by this information.

Exceptions
CrossReferenceException

◆ readTrailer()

AbstractReader::readTrailer ( )
protectedinherited

Read the trailer dictionary.

Exceptions
CrossReferenceException
PdfTypeException

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