Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

This file is part of FPDI

Copyright: Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com)
License: http://opensource.org/licenses/mit-license The MIT License
File Size: 326 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CrossReference:: (10 methods):
  __construct()
  getSize()
  getTrailer()
  getReaders()
  getOffsetFor()
  getIndirectObject()
  readXref()
  initReaderInstance()
  checkForEncryption()
  findStartXref()


Class: CrossReference  - X-Ref

Class CrossReference

This class processes the standard cross reference of a PDF document.
__construct(PdfParser $parser, $fileHeaderOffset = 0)   X-Ref
CrossReference constructor.

param: PdfParser $parser

getSize()   X-Ref
Get the size of the cross reference.

return: integer

getTrailer()   X-Ref
Get the trailer dictionary.

return: PdfDictionary

getReaders()   X-Ref
Get the cross reference readser instances.

return: ReaderInterface[]

getOffsetFor($objectNumber)   X-Ref
Get the offset by an object number.

param: int $objectNumber
return: integer|bool

getIndirectObject($objectNumber)   X-Ref
Get an indirect object by its object number.

param: int $objectNumber
return: PdfIndirectObject

readXref($offset)   X-Ref
Read the cross-reference table at a given offset.

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

param: int $offset
return: ReaderInterface

initReaderInstance($initValue)   X-Ref
Get a cross-reference reader instance.

param: PdfToken|PdfIndirectObject $initValue
return: ReaderInterface|bool

checkForEncryption(PdfDictionary $dictionary)   X-Ref
Check for encryption.

param: PdfDictionary $dictionary

findStartXref()   X-Ref
Find the start position for the first cross-reference.

return: int The byte-offset position of the first cross-reference.