setasign\Fpdi\PdfParser\Type

PdfString Class representing a PDF string object

File: /FPDI v2/PdfParser/Type/PdfString.php

Class hierarchy

Summary

Properties

$value

public mixed PdfType::$value

The value of the PDF type.


Static Methods

create()

public static PdfString::create (
string $value
): PdfString

Helper method to create an instance.

Parameters
$value : string

The string needs to be escaped accordingly.

ensure()

public static PdfString::ensure (
mixed $string
): PdfString

Ensures that the passed value is a PdfString instance.

Parameters
$string : mixed
 
Exceptions

Throws PdfTypeException

ensureType()

protected static PdfType::ensureType (
string $type, PdfType $value, string $errorMessage
): mixed

Ensure that a value is an instance of a specific PDF type.

Parameters
$type : string
 
$value : PdfType
 
$errorMessage : string
 
Exceptions

Throws PdfTypeException

escape()

public static PdfString::escape (
string $s
): string

Escapes sequences in a string according to the PDF specification.

Parameters
$s : string
 

flatten()

Flatten indirect object references to direct objects.

Parameters
$value : PdfType
 
$parser : \setasign\Fpdi\PdfParser\PdfParser
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

parse()

Parses a string object from the stream reader.

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

resolve()

public static PdfType::resolve (
PdfType $value, \setasign\Fpdi\PdfParser\PdfParser $parser [, bool $stopAtIndirectObject = false ]
): PdfType

Resolves a PdfType value to its value.

This method is used to evaluate indirect and direct object references until a final value is reached.

Parameters
$value : PdfType
 
$parser : \setasign\Fpdi\PdfParser\PdfParser
 
$stopAtIndirectObject : bool
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

unescape()

public static PdfString::unescape (
string $s
): string

Unescapes escaped sequences in a PDF string according to the PDF specification.

Parameters
$s : string