setasign\Fpdi\PdfParser\Type

PdfStream Class representing a PDF stream object

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

Class hierarchy

Summary

Properties

$reader

protected \setasign\Fpdi\PdfParser\StreamReader setasign\Fpdi\PdfParser\Type\PdfStream::$reader

The stream reader instance.

$stream

protected int|string setasign\Fpdi\PdfParser\Type\PdfStream::$stream

The stream or its byte-offset position.

$value

public mixed setasign\Fpdi\PdfParser\Type\PdfStream::$value

The value of the PDF type.


Static Methods

create()

public static PdfStream::create (
PdfDictionary $dictionary, string $stream
): PdfStream

Helper method to create an instance.

Parameters
$dictionary : PdfDictionary
 
$stream : string
 

ensure()

public static PdfStream::ensure (
mixed $stream
): PdfStream

Ensures that the passed value is a PdfStream instance.

Parameters
$stream : mixed
 

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

parse()

Parses a stream from a stream reader.

Parameters
$dictionary : PdfDictionary
 
$reader : \setasign\Fpdi\PdfParser\StreamReader
 
Exceptions

Throws PdfTypeException

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
 

Methods

getStream()

public PdfStream::getStream (
[ bool $cache = false ]
): bool|string

Get the stream data.

Parameters
$cache : bool

Whether cache the stream data or not.

getUnfilteredStream()

public PdfStream::getUnfilteredStream (
void
): string

Get the unfiltered stream data.

Exceptions

Throws \setasign\Fpdi\PdfParser\Filter\FilterException

Throws \setasign\Fpdi\PdfParser\PdfParserException