TCPDF_PARSER
in package
Tags
Table of Contents
Properties
- $objects : mixed
- Array of PDF objects.
- $xref : mixed
- XREF data.
- $cfg : mixed
- Array of configuration parameters.
- $FilterDecoders : mixed
- Class object for decoding filters.
- $pdfdata : mixed
- Raw content of the PDF document.
Methods
- __construct() : mixed
- Parse a PDF document an return an array of objects.
- Error() : mixed
- Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.
- getParsedData() : array<string|int, mixed>
- Return an array of parsed PDF document objects.
- decodeStream() : array<string|int, mixed>
- Decode the specified stream.
- decodeXref() : array<string|int, mixed>
- Decode the Cross-Reference section
- decodeXrefStream() : array<string|int, mixed>
- Decode the Cross-Reference Stream section
- getIndirectObject() : array<string|int, mixed>
- Get content of indirect object.
- getObjectVal() : array<string|int, mixed>
- Get the content of object, resolving indect object reference if necessary.
- getRawObject() : array<string|int, mixed>
- Get object type, raw value and offset to next object
- getXrefData() : array<string|int, mixed>
- Get Cross-Reference (xref) table and trailer data from PDF document data.
- setConfig() : mixed
- Set the configuration parameters.
Properties
$objects
Array of PDF objects.
protected
mixed
$objects
= array()
Tags
$xref
XREF data.
protected
mixed
$xref
= array()
Tags
$cfg
Array of configuration parameters.
private
mixed
$cfg
= array('die_for_errors' => \false, 'ignore_filter_decoding_errors' => \true, 'ignore_missing_filter_decoders' => \true)
Tags
$FilterDecoders
Class object for decoding filters.
private
mixed
$FilterDecoders
Tags
$pdfdata
Raw content of the PDF document.
private
mixed
$pdfdata
= ''
Tags
Methods
__construct()
Parse a PDF document an return an array of objects.
public
__construct(string $data[, array<string|int, mixed> $cfg = array() ]) : mixed
Parameters
- $data : string
-
PDF data to parse.
- $cfg : array<string|int, mixed> = 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.
Tags
Error()
Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.
public
Error(string $msg) : mixed
Parameters
- $msg : string
-
The error message
Tags
getParsedData()
Return an array of parsed PDF document objects.
public
getParsedData() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Array of parsed PDF document objects.
decodeStream()
Decode the specified stream.
protected
decodeStream(array<string|int, mixed> $sdic, string $stream) : array<string|int, mixed>
Parameters
- $sdic : array<string|int, mixed>
-
Stream's dictionary array.
- $stream : string
-
Stream to decode.
Tags
Return values
array<string|int, mixed> —containing decoded stream data and remaining filters.
decodeXref()
Decode the Cross-Reference section
protected
decodeXref(int $startxref[, array<string|int, mixed> $xref = array() ]) : array<string|int, mixed>
Parameters
- $startxref : int
-
Offset at which the xref section starts (position of the 'xref' keyword).
- $xref : array<string|int, mixed> = array()
-
Previous xref array (if any).
Tags
Return values
array<string|int, mixed> —containing xref and trailer data.
decodeXrefStream()
Decode the Cross-Reference Stream section
protected
decodeXrefStream(int $startxref[, array<string|int, mixed> $xref = array() ]) : array<string|int, mixed>
Parameters
- $startxref : int
-
Offset at which the xref section starts.
- $xref : array<string|int, mixed> = array()
-
Previous xref array (if any).
Tags
Return values
array<string|int, mixed> —containing xref and trailer data.
getIndirectObject()
Get content of indirect object.
protected
getIndirectObject(string $obj_ref[, int $offset = 0 ][, bool $decoding = true ]) : array<string|int, mixed>
Parameters
- $obj_ref : string
-
Object number and generation number separated by underscore character.
- $offset : int = 0
-
Object offset.
- $decoding : bool = true
-
If true decode streams.
Tags
Return values
array<string|int, mixed> —containing object data.
getObjectVal()
Get the content of object, resolving indect object reference if necessary.
protected
getObjectVal(string $obj) : array<string|int, mixed>
Parameters
- $obj : string
-
Object value.
Tags
Return values
array<string|int, mixed> —containing object data.
getRawObject()
Get object type, raw value and offset to next object
protected
getRawObject([int $offset = 0 ]) : array<string|int, mixed>
Parameters
- $offset : int = 0
-
Object offset.
Tags
Return values
array<string|int, mixed> —containing object type, raw value and offset to next object
getXrefData()
Get Cross-Reference (xref) table and trailer data from PDF document data.
protected
getXrefData([int $offset = 0 ][, array<string|int, mixed> $xref = array() ]) : array<string|int, mixed>
Parameters
- $offset : int = 0
-
xref offset (if know).
- $xref : array<string|int, mixed> = array()
-
previous xref array (if any).
Tags
Return values
array<string|int, mixed> —containing xref and trailer data.
setConfig()
Set the configuration parameters.
protected
setConfig(array<string|int, mixed> $cfg) : mixed
Parameters
- $cfg : array<string|int, mixed>
-
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.