Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
TCPDF_PARSER Class Reference

This is a PHP class for parsing PDF documents. More...

Public Member Functions

 __construct ($data, $cfg=array())
 Parse a PDF document an return an array of objects.
 
 Error ($msg)
 Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.
 
 getParsedData ()
 Return an array of parsed PDF document objects.
 

Protected Member Functions

 decodeStream ($sdic, $stream)
 Decode the specified stream.
 
 decodeXref ($startxref, $xref=array())
 Decode the Cross-Reference section.
 
 decodeXrefStream ($startxref, $xref=array())
 Decode the Cross-Reference Stream section.
 
 getIndirectObject ($obj_ref, $offset=0, $decoding=true)
 Get content of indirect object.
 
 getObjectVal ($obj)
 Get the content of object, resolving indect object reference if necessary.
 
 getRawObject ($offset=0)
 Get object type, raw value and offset to next object.
 
 getXrefData ($offset=0, $xref=array())
 Get Cross-Reference (xref) table and trailer data from PDF document data.
 
 setConfig ($cfg)
 Set the configuration parameters.
 

Protected Attributes

 $objects = array()
 Array of PDF objects.
 
 $xref = array()
 XREF data.
 

Detailed Description

This is a PHP class for parsing PDF documents.


..

This is a PHP class for parsing PDF documents..

Version
1.0.15
Author
Nicola Asuni - info@.nosp@m.tecn.nosp@m.ick.c.nosp@m.om

Constructor & Destructor Documentation

◆ __construct()

TCPDF_PARSER::__construct ( $data,
$cfg = array() )

Parse a PDF document an return an array of objects.

Parameters
string$dataPDF data to parse.
array$cfgArray of configuration parameters: 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; 'ignore_missing_filter_decoders' : if true ignore missing filter decoding errors.
Since
1.0.000 (2011-05-24)

Member Function Documentation

◆ decodeStream()

TCPDF_PARSER::decodeStream ( $sdic,
$stream )
protected

Decode the specified stream.

Parameters
array$sdicStream's dictionary array.
string$streamStream to decode.
Return values
arraycontaining decoded stream data and remaining filters.
Since
1.0.000 (2011-06-22)

◆ decodeXref()

TCPDF_PARSER::decodeXref ( $startxref,
$xref = array() )
protected

Decode the Cross-Reference section.

Parameters
int$startxrefOffset at which the xref section starts (position of the 'xref' keyword).
array$xrefPrevious xref array (if any).
Return values
arraycontaining xref and trailer data.
Since
1.0.000 (2011-06-20)

◆ decodeXrefStream()

TCPDF_PARSER::decodeXrefStream ( $startxref,
$xref = array() )
protected

Decode the Cross-Reference Stream section.

Parameters
int$startxrefOffset at which the xref section starts.
array$xrefPrevious xref array (if any).
Return values
arraycontaining xref and trailer data.
Since
1.0.003 (2013-03-16)

◆ Error()

TCPDF_PARSER::Error ( $msg)

Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.

Parameters
string$msgThe error message
Since
1.0.000 (2011-05-23)

◆ getIndirectObject()

TCPDF_PARSER::getIndirectObject ( $obj_ref,
$offset = 0,
$decoding = true )
protected

Get content of indirect object.

Parameters
string$obj_refObject number and generation number separated by underscore character.
int$offsetObject offset.
boolean$decodingIf true decode streams.
Return values
arraycontaining object data.
Since
1.0.000 (2011-05-24)

◆ getObjectVal()

TCPDF_PARSER::getObjectVal ( $obj)
protected

Get the content of object, resolving indect object reference if necessary.

Parameters
string$objObject value.
Return values
arraycontaining object data.
Since
1.0.000 (2011-06-26)

◆ getParsedData()

TCPDF_PARSER::getParsedData ( )

Return an array of parsed PDF document objects.

Return values
arrayArray of parsed PDF document objects.
Since
1.0.000 (2011-06-26)

◆ getRawObject()

TCPDF_PARSER::getRawObject ( $offset = 0)
protected

Get object type, raw value and offset to next object.

Parameters
int$offsetObject offset.
Return values
arraycontaining object type, raw value and offset to next object
Since
1.0.000 (2011-06-20)

◆ getXrefData()

TCPDF_PARSER::getXrefData ( $offset = 0,
$xref = array() )
protected

Get Cross-Reference (xref) table and trailer data from PDF document data.

Parameters
int$offsetxref offset (if know).
array$xrefprevious xref array (if any).
Return values
arraycontaining xref and trailer data.
Since
1.0.000 (2011-05-24)

◆ setConfig()

TCPDF_PARSER::setConfig ( $cfg)
protected

Set the configuration parameters.

Parameters
array$cfgArray of configuration parameters: 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; 'ignore_missing_filter_decoders' : if true ignore missing filter decoding errors.

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