Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

Author: Nicola Asuni
Version: 1.0.15
File Size: 815 lines (28 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TCPDF_PARSER:: (11 methods):
  __construct()
  setConfig()
  getParsedData()
  getXrefData()
  decodeXref()
  decodeXrefStream()
  getRawObject()
  getIndirectObject()
  getObjectVal()
  decodeStream()
  Error()


Class: TCPDF_PARSER  - X-Ref


__construct($data, $cfg=array()   X-Ref
Parse a PDF document an return an array of objects.

param: $data (string) PDF data to parse.
param: $cfg (array) Array of configuration parameters:

setConfig($cfg)   X-Ref
Set the configuration parameters.

param: $cfg (array) Array of configuration parameters:

getParsedData()   X-Ref
Return an array of parsed PDF document objects.

return: (array) Array of parsed PDF document objects.

getXrefData($offset=0, $xref=array()   X-Ref
Get Cross-Reference (xref) table and trailer data from PDF document data.

param: $offset (int) xref offset (if know).
param: $xref (array) previous xref array (if any).
return: Array containing xref and trailer data.

decodeXref($startxref, $xref=array()   X-Ref
Decode the Cross-Reference section

param: $startxref (int) Offset at which the xref section starts (position of the 'xref' keyword).
param: $xref (array) Previous xref array (if any).
return: Array containing xref and trailer data.

decodeXrefStream($startxref, $xref=array()   X-Ref
Decode the Cross-Reference Stream section

param: $startxref (int) Offset at which the xref section starts.
param: $xref (array) Previous xref array (if any).
return: Array containing xref and trailer data.

getRawObject($offset=0)   X-Ref
Get object type, raw value and offset to next object

param: $offset (int) Object offset.
return: array containing object type, raw value and offset to next object

getIndirectObject($obj_ref, $offset=0, $decoding=true)   X-Ref
Get content of indirect object.

param: $obj_ref (string) Object number and generation number separated by underscore character.
param: $offset (int) Object offset.
param: $decoding (boolean) If true decode streams.
return: array containing object data.

getObjectVal($obj)   X-Ref
Get the content of object, resolving indect object reference if necessary.

param: $obj (string) Object value.
return: array containing object data.

decodeStream($sdic, $stream)   X-Ref
Decode the specified stream.

param: $sdic (array) Stream's dictionary array.
param: $stream (string) Stream to decode.
return: array containing decoded stream data and remaining filters.

Error($msg)   X-Ref
Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.

param: $msg (string) The error message