setasign\FpdiPdfParser\PdfParser

PdfParser A PDF parser class

File: /FPDI PDF-Parser v2/PdfParser/PdfParser.php

Class hierarchy

Summary

Constants

PARAM_IGNORE_PERMISSIONS

public const string PdfParser::PARAM_IGNORE_PERMISSIONS = 'ignorePermissions'

PARAM_OWNER_PASSWORD

public const string PdfParser::PARAM_OWNER_PASSWORD = 'ownerPassword'

PARAM_PASSWORD

public const string PdfParser::PARAM_PASSWORD = 'password'

PARAM_USER_PASSWORD

public const string PdfParser::PARAM_USER_PASSWORD = 'userPassword'

Properties

$currentIndirectObjectGenerationNumber

$currentIndirectObjectNumber

$fileHeader

protected string \setasign\Fpdi\PdfParser\PdfParser::$fileHeader

The file header.

$fileHeaderOffset

protected int \setasign\Fpdi\PdfParser\PdfParser::$fileHeaderOffset

The offset to the file header.

$objects

protected array \setasign\Fpdi\PdfParser\PdfParser::$objects = array()

All read objects.

$parserParams

protected array PdfParser::$parserParams = array()

$streamReader

protected \setasign\Fpdi\PdfParser\StreamReader \setasign\Fpdi\PdfParser\PdfParser::$streamReader

$tokenizer

protected \setasign\Fpdi\PdfParser\Tokenizer \setasign\Fpdi\PdfParser\PdfParser::$tokenizer

$xref

protected \setasign\Fpdi\PdfParser\CrossReference\CrossReference|null \setasign\Fpdi\PdfParser\PdfParser::$xref

Methods

__construct()

public PdfParser::__construct (
\setasign\Fpdi\PdfParser\StreamReader $streamReader [, array $parserParams = array ( ) ]
)

PdfParser constructor.

Parameters
$streamReader : \setasign\Fpdi\PdfParser\StreamReader
 
$parserParams : array
 
Exceptions

Throws \setasign\Fpdi\FpdiException

decryptStream()

protected PdfParser::decryptStream (
\setasign\Fpdi\PdfParser\Type\PdfStream $stream, int $objectNumber, int $generationNumber
): string
Parameters
$stream : \setasign\Fpdi\PdfParser\Type\PdfStream
 
$objectNumber : int
 
$generationNumber : int
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

Throws SecHandler\SecHandlerException

ensureExpectedType()

protected \setasign\Fpdi\PdfParser\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 \setasign\Fpdi\PdfParser\Type\PdfTypeException

getCatalog()

public \setasign\Fpdi\PdfParser\PdfParser::getCatalog (
void
): \setasign\Fpdi\PdfParser\Type\PdfDictionary

Get the catalog dictionary.

Exceptions

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

getCrossReference()

Get the cross-reference instance.

Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

getIndirectObject()

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

Get an indirect object by its object number.

Parameters
$objectNumber : int
 
$cache : bool
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

getPdfVersion()

public \setasign\Fpdi\PdfParser\PdfParser::getPdfVersion (
void
): int[]

Get the PDF version.

Return Values

An array of major and minor version.

Exceptions

Throws \setasign\Fpdi\PdfParser\PdfParserException

getSecHandler()

Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

getStreamReader()

public \setasign\Fpdi\PdfParser\PdfParser::getStreamReader (
void
): \setasign\Fpdi\PdfParser\StreamReader

Get the stream reader instance.

getTokenizer()

public \setasign\Fpdi\PdfParser\PdfParser::getTokenizer (
void
): \setasign\Fpdi\PdfParser\Tokenizer

Get the tokenizer instance.

parsePdfArray()

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

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

parsePdfDictionary()

protected \setasign\Fpdi\PdfParser\PdfParser::parsePdfDictionary (
void
): bool|\setasign\Fpdi\PdfParser\Type\PdfDictionary
Exceptions

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

parsePdfHexString()

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

Throws SecHandler\SecHandlerException

parsePdfIndirectObject()

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

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

Throws SecHandler\SecHandlerException

parsePdfName()

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

parsePdfString()

protected PdfParser::parsePdfString (
void
): \setasign\Fpdi\PdfParser\Type\PdfString
Exceptions

Throws SecHandler\SecHandlerException

readValue()

public \setasign\Fpdi\PdfParser\PdfParser::readValue (
[ null|bool|string $token = null [, null|string $expectedType = null ]]
): false|\setasign\Fpdi\PdfParser\Type\PdfArray|\setasign\Fpdi\PdfParser\Type\PdfBoolean|\setasign\Fpdi\PdfParser\Type\PdfDictionary|\setasign\Fpdi\PdfParser\Type\PdfHexString|\setasign\Fpdi\PdfParser\Type\PdfIndirectObject|\setasign\Fpdi\PdfParser\Type\PdfIndirectObjectReference|\setasign\Fpdi\PdfParser\Type\PdfName|\setasign\Fpdi\PdfParser\Type\PdfNull|\setasign\Fpdi\PdfParser\Type\PdfNumeric|\setasign\Fpdi\PdfParser\Type\PdfStream|\setasign\Fpdi\PdfParser\Type\PdfString|\setasign\Fpdi\PdfParser\Type\PdfToken

Read a PDF value.

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

Throws \setasign\Fpdi\PdfParser\Type\PdfTypeException

resolveFileHeader()

protected \setasign\Fpdi\PdfParser\PdfParser::resolveFileHeader (
void
): int

Resolves the file header.

Exceptions

Throws \setasign\Fpdi\PdfParser\PdfParserException