setasign\Fpdi\PdfParser

PdfParser A PDF parser class

File: /FPDI v2/PdfParser/PdfParser.php

Class hierarchy

Summary

Properties

$fileHeader

protected string PdfParser::$fileHeader

The file header.

$fileHeaderOffset

The offset to the file header.

$objects

protected array PdfParser::$objects = array()

All read objects.

$streamReader

$tokenizer


Methods

__construct()

public PdfParser::__construct (
StreamReader $streamReader
)

PdfParser constructor.

Parameters
$streamReader : StreamReader
 

ensureExpectedType()

protected PdfParser::ensureExpectedType (
string $token, string|null $expectedType
): bool

Ensures that the token will evaluate to an expected object type (or not).

Parameters
$token : string
 
$expectedType : string|null
 
Exceptions

Throws Type\PdfTypeException

getCatalog()

Get the catalog dictionary.

Exceptions

Throws Type\PdfTypeException

Throws CrossReference\CrossReferenceException

Throws PdfParserException

getCrossReference()

Get the cross-reference instance.

Exceptions

Throws CrossReference\CrossReferenceException

Throws PdfParserException

getIndirectObject()

public PdfParser::getIndirectObject (
int $objectNumber [, bool $cache = false ]
): Type\PdfIndirectObject

Get an indirect object by its object number.

Parameters
$objectNumber : int
 
$cache : bool
 
Exceptions

Throws CrossReference\CrossReferenceException

Throws PdfParserException

getPdfVersion()

public PdfParser::getPdfVersion (
void
): int[]

Get the PDF version.

Return Values

An array of major and minor version.

Exceptions

Throws PdfParserException

getStreamReader()

Get the stream reader instance.

getTokenizer()

public PdfParser::getTokenizer (
void
): Tokenizer

Get the tokenizer instance.

parsePdfArray()

protected PdfParser::parsePdfArray (
void
): false|Type\PdfArray
Exceptions

Throws Type\PdfTypeException

parsePdfDictionary()

Exceptions

Throws Type\PdfTypeException

parsePdfHexString()

protected PdfParser::parsePdfHexString (
void
): false|Type\PdfHexString

parsePdfIndirectObject()

protected PdfParser::parsePdfIndirectObject (
int $objectNumber, int $generationNumber
): false|Type\PdfIndirectObject
Parameters
$objectNumber : int
 
$generationNumber : int
 
Exceptions

Throws Type\PdfTypeException

parsePdfName()

protected PdfParser::parsePdfName (
void
): Type\PdfName

parsePdfString()

readValue()

Read a PDF value.

Parameters
$token : null|bool|string
 
$expectedType : null|string
 
Exceptions

Throws Type\PdfTypeException

resolveFileHeader()

protected PdfParser::resolveFileHeader (
void
): int

Resolves the file header.

Exceptions

Throws PdfParserException