setasign\SetaPDF2\Core

FileSpecification Class representing a file specification

File: /SetaPDF v2/Core/FileSpecification.php
Old class name (alias): \SetaPDF_Core_FileSpecification

Class hierarchy

Summary

Constants

FILE_SYSTEM_UNDEFINED

public const null FileSpecification::FILE_SYSTEM_UNDEFINED = NULL

Default file system constant

FILE_SYSTEM_URL

public const string FileSpecification::FILE_SYSTEM_URL = 'URL'

URL file system contant


Properties

$_dictionary


Static Methods

createDictionary()

public static FileSpecification::createDictionary (
string $fileSpecificationString
): \SetaPDF_Core_Type_Dictionary

Creates a file specification dictionary.

Parameters
$fileSpecificationString : string
 

createEmbedded()

public static FileSpecification::createEmbedded (
\SetaPDF_Core_Document $document,
\SetaPDF_Core_Reader_ReaderInterface|string $pathOrReader,
string $filename,
array $fileStreamParams = array ( ),
?string $mimeType = null
): \SetaPDF_Core_FileSpecification

Create a file specification with an embedded file stream.

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

A reader instance or a path to a file.

$filename : string

The filename in UTF-8 encoding.

$fileStreamParams : 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


Methods

__construct()

The constructor.

If the parameter cannot be evaluated to a dictionary it will be passed to the createDictionary method to create an appropriate dictionary.

Parameters
$fileSpecification : string|\SetaPDF_Core_Type_IndirectObjectInterface|\SetaPDF_Core_Type_Dictionary|\SetaPDF_Core_Type_StringValue
 
Exceptions

Throws Type\Exception

See

getCollectionItem()

Get the collection item data.

getDescription()

public FileSpecification::getDescription (
string $encoding = 'UTF-8'
): ?string

Get the descriptive text associated with the file specification.

Parameters
$encoding : string
 

getDictionary()

Get the dictionary.

getEmbeddedFileStream()

Get the embedded file stream object.

Parameters
$unicode : bool

If true use the UF key, otherwise the F key.

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

getFileSpecification()

public FileSpecification::getFileSpecification (
void
): ?string

Get the file specification value.

getFileSystem()

public FileSpecification::getFileSystem (
void
): ?string

Get name of the file system.

getUnicodeFileSpecification()

public FileSpecification::getUnicodeFileSpecification (
string $encoding = 'UTF-8'
): ?string

Get the unicode text file specification value.

Parameters
$encoding : string
 

getVolatile()

public FileSpecification::getVolatile (
void
): bool

Get the volatile flag.

setCollectionItem()

Set the collection item data.

Parameters
$item : ?\SetaPDF_Core_Type_Dictionary
 

setDescription()

public FileSpecification::setDescription (
?string $desc,
string $encoding = 'UTF-8'
): void

Set the descriptive text associated with the file specification.

Parameters
$desc : ?string
 
$encoding : string
 

setEmbeddedFileStream()

public FileSpecification::setEmbeddedFileStream (
\SetaPDF_Core_EmbeddedFileStream $embeddedFileStream,
bool $unicode = false
): void

Set the embedded file stream object.

Parameters
$embeddedFileStream : \SetaPDF_Core_EmbeddedFileStream
 
$unicode : bool

If true use the UF key, otherwise the F key.

setFileSpecification()

public FileSpecification::setFileSpecification (
?string $fileSpecification
): void

Set the file specification value.

Parameters
$fileSpecification : ?string
 

setFileSystem()

public FileSpecification::setFileSystem (
?string $fileSystem
): void

Set the file system name.

Parameters
$fileSystem : ?string
 

setUnicodeFileSpecification()

public FileSpecification::setUnicodeFileSpecification (
?string $fileSpecification,
string $encoding = 'UTF-8'
): void

Set the unicode text file specification value.

Parameters
$fileSpecification : ?string
 
$encoding : string
 

setVolatile()

public FileSpecification::setVolatile (
?bool $volatile
): void

Set the volatile flag.

Parameters
$volatile : ?bool