PdfString
extends PdfType
in package
Class representing a PDF string 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 PdfString instance.
- escape() : string
- Escapes sequences in a string according to the PDF specification.
- flatten() : PdfType
- Flatten indirect object references to direct objects.
- parse() : self
- Parses a string object from the stream reader.
- resolve() : PdfType
- Resolves a PdfType value to its value.
- unescape() : string
- Unescapes escaped sequences in a PDF string according to the PDF specification.
- 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(string $value) : self
Parameters
- $value : string
-
The string needs to be escaped accordingly.
Return values
selfensure()
Ensures that the passed value is a PdfString instance.
public
static ensure(mixed $string) : self
Parameters
- $string : mixed
Tags
Return values
selfescape()
Escapes sequences in a string according to the PDF specification.
public
static escape(string $s) : string
Parameters
- $s : string
Return values
stringflatten()
Flatten indirect object references to direct objects.
public
static flatten(PdfType $value, PdfParser $parser) : PdfType
Parameters
Tags
Return values
PdfTypeparse()
Parses a string object from the stream reader.
public
static parse(StreamReader $streamReader) : self
Parameters
- $streamReader : StreamReader
Return values
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
PdfTypeunescape()
Unescapes escaped sequences in a PDF string according to the PDF specification.
public
static unescape(string $s) : string
Parameters
- $s : string
Return values
stringensureType()
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