setasign\Fpdi\PdfParser\Type

PdfStream Class representing a PDF stream object

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

Class hierarchy

Summary

Properties

$parser

The PDF parser instance.

$reader

The stream reader instance.

$stream

protected int|string PdfStream::$stream

The stream or its byte-offset position.

$value

public mixed PdfType::$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
 
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

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 stream from a stream reader.

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

Optional to keep backwards compatibility

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
 
Exceptions

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException


Methods

extractStream()

protected PdfStream::extractStream (
void
): string

Extract the stream "manually".

Exceptions

Throws PdfTypeException

getFilters()

public PdfStream::getFilters (
void
): PdfType[]

Get all filters defined for this stream.

Exceptions

Throws PdfTypeException

getStream()

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

Get the stream data.

Parameters
$cache : bool

Whether cache the stream data or not.

Exceptions

Throws PdfTypeException

Throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException

Throws \setasign\Fpdi\PdfParser\PdfParserException

getUnfilteredStream()

public PdfStream::getUnfilteredStream (
void
): string

Get the unfiltered stream data.

Exceptions

Throws \setasign\Fpdi\PdfParser\Filter\FilterException

Throws \setasign\Fpdi\PdfParser\PdfParserException