setasign\SetaPDF2\Core\Document\Catalog\Names

EmbeddedFiles Class allowing access to embedded files.

File: /SetaPDF v2/Core/Document/Catalog/Names/EmbeddedFiles.php
Old class name (alias): \SetaPDF_Core_Document_Catalog_Names_EmbeddedFiles

Class hierarchy

Summary

Properties

$_names


Methods

__construct()

_getTree()

private EmbeddedFiles::_getTree (
bool $create = false
): ?\SetaPDF_Core_DataStructure_NameTree

Get the tree instance.

Parameters
$create : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

add()

Adds an embedded file by its file specification.

Parameters
$name : string

The unique name in the name tree for embedded files. This string shall be a PDF string in PDFDoc encoding or UTF-16BE.

$fileSpecification : \SetaPDF_Core_FileSpecification
 
Exceptions

Throws \setasign\SetaPDF2\Core\DataStructure\Tree\KeyAlreadyExistsException

Throws \setasign\SetaPDF2\Core\Type\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

cleanUp()

public EmbeddedFiles::cleanUp (
void
): void

Release cycled references.

get()

public EmbeddedFiles::get (
string $name
): false|\SetaPDF_Core_FileSpecification

Get an embedded file by its name.

Parameters
$name : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

remove()

public EmbeddedFiles::remove (
string $name,
bool $removeObjects = true
): bool

Remove an embedded file.

Parameters
$name : string

No encoding is used. The name needs to be passed as it is registered in the name tree.

$removeObjects : bool

If this is set to false only the registration in the name tree is removed. By default also the embedded streams will be deleted.

Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception