Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250530) (c39b7370636)
PdfString Class Reference

Class representing a PDF string object. More...

Inheritance diagram for PdfString:
PdfType

Static Public Member Functions

static create ($value)
 Helper method to create an instance.
 
static ensure ($string)
 Ensures that the passed value is a PdfString instance.
 
static escape ($s)
 Escapes sequences in a string according to the PDF specification.
 
static flatten (PdfType $value, PdfParser $parser)
 Flatten indirect object references to direct objects.
 
static parse (StreamReader $streamReader)
 Parses a string object from the stream reader.
 
static resolve (PdfType $value, PdfParser $parser, $stopAtIndirectObject=false)
 Resolves a PdfType value to its value.
 
static unescape ($s)
 Unescapes escaped sequences in a PDF string according to the PDF specification.
 

Public Attributes

mixed $value
 The value of the PDF type.
 

Static Protected Member Functions

static ensureType ($type, $value, $errorMessage)
 Ensure that a value is an instance of a specific PDF type.
 

Detailed Description

Class representing a PDF string object.

Member Function Documentation

◆ create()

static PdfString::create ( $value)
static

Helper method to create an instance.

Parameters
string$valueThe string needs to be escaped accordingly.
Return values
self

◆ ensure()

static PdfString::ensure ( $string)
static

Ensures that the passed value is a PdfString instance.

Parameters
mixed$string
Return values
self
Exceptions
PdfTypeException

◆ ensureType()

static PdfType::ensureType ( $type,
$value,
$errorMessage )
staticprotectedinherited

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

Parameters
string$type
PdfType$value
string$errorMessage
Return values
mixed
Exceptions
PdfTypeException

◆ escape()

static PdfString::escape ( $s)
static

Escapes sequences in a string according to the PDF specification.

Parameters
string$s
Return values
string

◆ flatten()

static PdfType::flatten ( PdfType $value,
PdfParser $parser )
staticinherited

Flatten indirect object references to direct objects.

Parameters
PdfType$value
PdfParser$parser
Return values
PdfType
Exceptions
CrossReferenceException
PdfParserException

◆ parse()

static PdfString::parse ( StreamReader $streamReader)
static

Parses a string object from the stream reader.

Parameters
StreamReader$streamReader
Return values
self

◆ resolve()

static PdfType::resolve ( PdfType $value,
PdfParser $parser,
$stopAtIndirectObject = false )
staticinherited

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
PdfType$value
PdfParser$parser
bool$stopAtIndirectObject
Return values
PdfType
Exceptions
CrossReferenceException
PdfParserException

◆ unescape()

static PdfString::unescape ( $s)
static

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

Parameters
string$s
Return values
string

The documentation for this class was generated from the following file: