Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

(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: string $data PDF data to parse.
param: array $cfg Array of configuration parameters:

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

param: array $cfg 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: int $offset xref offset (if know).
param: array $xref previous xref array (if any).
return: array containing xref and trailer data.

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

param: int $startxref Offset at which the xref section starts (position of the 'xref' keyword).
param: array $xref 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: int $startxref Offset at which the xref section starts.
param: array $xref 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: int $offset 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: string $obj_ref Object number and generation number separated by underscore character.
param: int $offset Object offset.
param: boolean $decoding 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: string $obj Object value.
return: array containing object data.

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

param: array $sdic Stream's dictionary array.
param: string $stream 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: string $msg The error message