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()

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

readValue()

Read a PDF value.

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

Throws Type\PdfTypeException

resolveFileHeader()

protected PdfParser::resolveFileHeader (
void
): void

Resolves the file header.

Exceptions

Throws PdfParserException