TCPDF_PARSER

class

TCPDF_PARSER This is a PHP class for parsing PDF documents.

package

com.tecnick.tcpdf

brief

This is a PHP class for parsing PDF documents..

version 1.0.15
author

Nicola Asuni - info@tecnick.com

Methods

Parse a PDF document an return an array of objects.

__construct(string $data,array $cfg = array())
public
since 1.0.000

(2011-05-24)

Arguments

$data

string

PDF data to parse.

$cfg

array

Array 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.

Decode the specified stream.

decodeStream(array $sdic,string $stream): array
protected
since 1.0.000

(2011-06-22)

Arguments

$sdic

array

Stream's dictionary array.

$stream

string

Stream to decode.

Response

array

containing decoded stream data and remaining filters.

Decode the Cross-Reference section

decodeXref(integer $startxref,array $xref = array()): array
protected
since 1.0.000

(2011-06-20)

Arguments

$startxref

integer

Offset at which the xref section starts (position of the 'xref' keyword).

$xref

array

Previous xref array (if any).

Response

array

containing xref and trailer data.

Decode the Cross-Reference Stream section

decodeXrefStream(integer $startxref,array $xref = array()): array
protected
since 1.0.003

(2013-03-16)

Arguments

$startxref

integer

Offset at which the xref section starts.

$xref

array

Previous xref array (if any).

Response

array

containing xref and trailer data.

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

Error(string $msg)
public
since 1.0.000

(2011-05-23)

Arguments

$msg

string

The error message

Get content of indirect object.

getIndirectObject(string $obj_ref,integer $offset,boolean $decoding = true): array
protected
since 1.0.000

(2011-05-24)

Arguments

$obj_ref

string

Object number and generation number separated by underscore character.

$offset

integer

Object offset.

$decoding

boolean

If true decode streams.

Response

array

containing object data.

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

getObjectVal(string $obj): array
protected
since 1.0.000

(2011-06-26)

Arguments

$obj

string

Object value.

Response

array

containing object data.

Return an array of parsed PDF document objects.

getParsedData(): array
public
since 1.0.000

(2011-06-26)

Response

array

Array of parsed PDF document objects.

Get object type, raw value and offset to next object

getRawObject(integer $offset): array
protected
since 1.0.000

(2011-06-20)

Arguments

$offset

integer

Object offset.

Response

array

containing object type, raw value and offset to next object

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

getXrefData(integer $offset,array $xref = array()): array
protected
since 1.0.000

(2011-05-24)

Arguments

$offset

integer

xref offset (if know).

$xref

array

previous xref array (if any).

Response

array

containing xref and trailer data.

Set the configuration parameters.

setConfig(array $cfg)
public

Arguments

$cfg

array

Array 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.

Properties

Raw content of the PDF document.

pdfdata :
private

Type(s)

XREF data.

xref :
protected

Type(s)

Array of PDF objects.

objects :
protected

Type(s)

Class object for decoding filters.

FilterDecoders :
private

Type(s)

Array of configuration parameters.

cfg :
private

Type(s)