PdfDictionary
extends PdfType
in package
Class representing a PDF dictionary object
Table of Contents
Properties
- $value : mixed
- The value of the PDF type.
Methods
- create() : self
- Helper method to create an instance.
- ensure() : self
- Ensures that the passed value is a PdfDictionary instance.
- flatten() : PdfType
- Flatten indirect object references to direct objects.
- get() : PdfNull|PdfType
- Get a value by its key from a dictionary or a default value.
- parse() : bool|self
- Parses a dictionary of the passed tokenizer, stream-reader and parser.
- resolve() : PdfType
- Resolves a PdfType value to its value.
- ensureType() : mixed
- Ensure that a value is an instance of a specific PDF type.
Properties
$value
The value of the PDF type.
public
mixed
$value
Methods
create()
Helper method to create an instance.
public
static create([array<string|int, PdfType> $entries = [] ]) : self
Parameters
- $entries : array<string|int, PdfType> = []
-
The keys are the name entries of the dictionary.
Return values
selfensure()
Ensures that the passed value is a PdfDictionary instance.
public
static ensure(mixed $dictionary) : self
Parameters
- $dictionary : mixed
Tags
Return values
selfflatten()
Flatten indirect object references to direct objects.
public
static flatten(PdfType $value, PdfParser $parser) : PdfType
Parameters
Tags
Return values
PdfTypeget()
Get a value by its key from a dictionary or a default value.
public
static get(mixed $dictionary, string $key[, PdfType|null $default = null ]) : PdfNull|PdfType
Parameters
- $dictionary : mixed
- $key : string
- $default : PdfType|null = null
Tags
Return values
PdfNull|PdfTypeparse()
Parses a dictionary of the passed tokenizer, stream-reader and parser.
public
static parse(Tokenizer $tokenizer, StreamReader $streamReader, PdfParser $parser) : bool|self
Parameters
- $tokenizer : Tokenizer
- $streamReader : StreamReader
- $parser : PdfParser
Tags
Return values
bool|selfresolve()
Resolves a PdfType value to its value.
public
static resolve(PdfType $value, PdfParser $parser[, bool $stopAtIndirectObject = false ][, array<string|int, mixed> &$ensuredObjectsList = [] ]) : PdfType
This method is used to evaluate indirect and direct object references until a final value is reached.
Parameters
- $value : PdfType
- $parser : PdfParser
- $stopAtIndirectObject : bool = false
- $ensuredObjectsList : array<string|int, mixed> = []
-
A list of all ensured indirect objects to prevent recursion
Tags
Return values
PdfTypeensureType()
Ensure that a value is an instance of a specific PDF type.
protected
static ensureType(string $type, PdfType $value, string $errorMessage) : mixed
Parameters
- $type : string
- $value : PdfType
- $errorMessage : string