PdfStream
extends PdfType
in package
Class representing a PDF stream object
Table of Contents
Properties
- $value : mixed
- The value of the PDF type.
- $parser : PdfParser
- The PDF parser instance.
- $reader : StreamReader|null
- The stream reader instance.
- $stream : int|string
- The stream or its byte-offset position.
Methods
- create() : self
- Helper method to create an instance.
- ensure() : self
- Ensures that the passed value is a PdfStream instance.
- flatten() : PdfType
- Flatten indirect object references to direct objects.
- getFilters() : array<string|int, PdfType>
- Get all filters defined for this stream.
- getStream() : bool|string
- Get the stream data.
- getUnfilteredStream() : string
- Get the unfiltered stream data.
- parse() : self
- Parses a stream from a stream reader.
- resolve() : PdfType
- Resolves a PdfType value to its value.
- ensureType() : mixed
- Ensure that a value is an instance of a specific PDF type.
- extractStream() : string
- Extract the stream "manually".
Properties
$value
The value of the PDF type.
public
mixed
$value
$parser
The PDF parser instance.
protected
PdfParser
$parser
$reader
The stream reader instance.
protected
StreamReader|null
$reader
$stream
The stream or its byte-offset position.
protected
int|string
$stream
Methods
create()
Helper method to create an instance.
public
static create(PdfDictionary $dictionary, string $stream) : self
Parameters
- $dictionary : PdfDictionary
- $stream : string
Return values
selfensure()
Ensures that the passed value is a PdfStream instance.
public
static ensure(mixed $stream) : self
Parameters
- $stream : mixed
Tags
Return values
selfflatten()
Flatten indirect object references to direct objects.
public
static flatten(PdfType $value, PdfParser $parser) : PdfType
Parameters
Tags
Return values
PdfTypegetFilters()
Get all filters defined for this stream.
public
getFilters() : array<string|int, PdfType>
Tags
Return values
array<string|int, PdfType>getStream()
Get the stream data.
public
getStream([bool $cache = false ]) : bool|string
Parameters
- $cache : bool = false
-
Whether cache the stream data or not.
Tags
Return values
bool|stringgetUnfilteredStream()
Get the unfiltered stream data.
public
getUnfilteredStream() : string
Tags
Return values
stringparse()
Parses a stream from a stream reader.
public
static parse(PdfDictionary $dictionary, StreamReader $reader[, PdfParser|null $parser = null ]) : self
Parameters
- $dictionary : PdfDictionary
- $reader : StreamReader
- $parser : PdfParser|null = null
-
Optional to keep backwards compatibility
Tags
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
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
Tags
extractStream()
Extract the stream "manually".
protected
extractStream() : string