Serializer
in package
FinalYes
Writes PDF values in PDF syntax.
Table of Contents
Methods
- number() : string
- A number, written without an exponent, since PDF has none, and without trailing zeros.
- value() : string
- A value in PDF syntax.
- dictionary() : string
- A `<<…>>` dictionary.
- literal() : string
- A `(…)` string, escaping the bytes that would end or alter it.
- name() : string
- A name, escaping with `#xx` any byte that is not a regular printable character.
- stream() : string
- A stream: its dictionary with `/Length` set to the data's, then the data.
Methods
number()
A number, written without an exponent, since PDF has none, and without trailing zeros.
public
static number(int|float $number) : string
Parameters
- $number : int|float
-
The number.
Tags
Return values
stringvalue()
A value in PDF syntax.
public
static value(mixed $value) : string
Parameters
- $value : mixed
-
A Name, PdfString, Dictionary, Stream, Reference, list, int, float, bool or null.
Tags
Return values
stringdictionary()
A `<<…>>` dictionary.
private
static dictionary(Dictionary $dictionary) : string
Parameters
- $dictionary : Dictionary
-
The dictionary.
Return values
stringliteral()
A `(…)` string, escaping the bytes that would end or alter it.
private
static literal(string $bytes) : string
Parameters
- $bytes : string
-
The string.
Return values
stringname()
A name, escaping with `#xx` any byte that is not a regular printable character.
private
static name(string $value) : string
Parameters
- $value : string
-
The name, without its slash.
Return values
stringstream()
A stream: its dictionary with `/Length` set to the data's, then the data.
private
static stream(Stream $stream) : string
Parameters
- $stream : Stream
-
The stream.