Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 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.

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

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

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

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

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

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

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

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

return: array containing object data.
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.

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

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

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

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

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