setasign\SetaPDF2\Core

EmbeddedFileStream Class representing an embedded file stream

File: /SetaPDF v2/Core/EmbeddedFileStream.php
Old class name (alias): \SetaPDF_Core_EmbeddedFileStream

Class hierarchy

Summary

Constants

PARAM_CHECK_SUM

public const string EmbeddedFileStream::PARAM_CHECK_SUM = 'CheckSum'

Constanst for the "CheckSum" key in a embedded file parameter dictionary.

The checksum shall be calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream.

PARAM_CREATION_DATE

public const string EmbeddedFileStream::PARAM_CREATION_DATE = 'CreationDate'

Constanst for the "CreationDate" key in a embedded file parameter dictionary.

PARAM_MODIFICATION_DATE

public const string EmbeddedFileStream::PARAM_MODIFICATION_DATE = 'ModDate'

Constanst for the "ModDate" key in a embedded file parameter dictionary.

PARAM_SIZE

public const string EmbeddedFileStream::PARAM_SIZE = 'Size'

Constanst for the "Size" key in a embedded file parameter dictionary.


Properties

$_indirectObject


Static Methods

create()

public static EmbeddedFileStream::create (
\SetaPDF_Core_Document $document,
\SetaPDF_Core_Reader_ReaderInterface|string $pathOrReader,
array $params = array ( ),
?string $mimeType = null
): \SetaPDF_Core_EmbeddedFileStream

Create an embedded file stream.

Parameters
$document : \SetaPDF_Core_Document
 
$pathOrReader : \SetaPDF_Core_Reader_ReaderInterface|string

A reader instance or a path to a file.

$params : array

See setParams() method.

$mimeType : ?string

The subtype of the embedded file. Shall conform to the MIME media type names defined in Internet RFC 2046

Exceptions

Throws Document\ObjectNotFoundException

Throws Exception

Throws Parser\Pdf\InvalidTokenException

Throws Reader\Exception

Throws Type\Exception

Throws Type\IndirectReference\Exception

Throws \setasign\SetaPDF2\Exception

Throws \setasign\SetaPDF2\NotImplementedException

Throws \Exception


Methods

_getDictionary()

Get the stream dictionary.

Exceptions

Throws Type\Exception

getIndirectObject()

getMimeType()

public EmbeddedFileStream::getMimeType (
void
): ?string

Get the subtype of the embedded file.

Exceptions

Throws Type\Exception

getParams()

public EmbeddedFileStream::getParams (
void
): array

Get the entries and data of the embedded file parameter dictionary.

Exceptions

Throws Type\Exception

getStream()

public EmbeddedFileStream::getStream (
void
): string

Get the stream content.

Exceptions

Throws Type\Exception

Throws \setasign\SetaPDF2\Exception

Throws \setasign\SetaPDF2\NotImplementedException

setMimeType()

public EmbeddedFileStream::setMimeType (
?string $mimeType
): void

Set the mime type (or subtype) of the embedded file stream.

Parameters
$mimeType : ?string
 
Exceptions

Throws Type\Exception

setParams()

public EmbeddedFileStream::setParams (
array $params,
bool $reset = true
): void

Set the entries in the embedded file parameter dictionary.

Parameters
$params : array

See class constants self::PARAMS_* for possible keys.

$reset : bool

Defines whether to remove all previously set entries or not.

Exceptions

Throws \Exception

See