setasign\SetaPDF2\Core\Document

Catalog A class representing the document catalog

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

Class hierarchy

Summary

Properties

$_acroForm

The documents AcroForm object

$_additionalActions

$_dests

The destinations object of the catalog

$_document

The document instance

$_extensions

$_markInfo

The mark information object

$_names

$_optionalContent

$_outlines

The documents outlines object

$_outputIntents

$_pageLabels

The documents page labels object

$_pages

$_permissions

$_structTreeRoot

The root structure tree object

$_viewerPreferences


Static Methods

getDocumentMagicMethods()

public static Catalog::getDocumentMagicMethods (
void
): array

Returns method names which should be available in a documents instance too.


Methods

__construct()

The constructor.

Parameters
$document : \SetaPDF_Core_Document
 

cleanUp()

public Catalog::cleanUp (
void
): void

Release cycled references / memory.

getAcroForm()

Get the documents AcroForm object.

This method resolves or creates the AcroForm dictionary and returns it.

getAdditionalActions()

Get the additional actions object.

getBaseUri()

public Catalog::getBaseUri (
void
): ?string

Get the base URI that shall be used in resolving relative URI references.

URI actions within the document may specify URIs in partial form, to be interpreted relative to this base address. If no base URI is specified, such partial URIs shall be interpreted relative to the location of the document itself.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getDests()

Get the documents destination dictionary helper object.

getDictionary()

public Catalog::getDictionary (
bool $create = false
): ?\SetaPDF_Core_Type_Dictionary

Get the catalog dictionary.

Parameters
$create : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getDocument()

Get the document instance.

getExtensions()

Get the extensions helper instance.

getLang()

public Catalog::getLang (
string $encoding = 'UTF-8'
): ?string

Get the language identifier.

Parameters
$encoding : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getMarkInfo()

Get the mark information object.

getMetadata()

public Catalog::getMetadata (
void
): ?string

Get the metadata stream.

This is a method for low level access to the XMP stream data. The Info class offers a same named method, that allows you to access the XMP package via a \DOMDocument instance.

The class also allows you to automatically sync Info dictionary data with the XMP metadata.

Return Values

Null if no document metadata are available.
A string if the desired structure is available.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getNames()

Get a names object from the document.

getOpenAction()

Get the open action.

The open action entry specifies a destination that shall be displayed or an action that shall be executed when the document is opened.

Additional document related actions could be get or set in the Catalog\AdditionalActions class that could be get with the getAdditionalActions() method.

Return Values

An action or destination instance or null if no open action is defined.

Exceptions

Throws \setasign\SetaPDF2\Core\Exception

getOptionalContent()

Get the documents optional content object.

getOutlines()

Get the documents outline object.

getOutputIntents()

Get the output intents object.

getPageLabels()

Get the documents page labels object.

getPageLayout()

public Catalog::getPageLayout (
void
): string

Get the page layout.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See
  • PDF 32000-1:2008 - 7.7.2 Document Catalog

getPageMode()

public Catalog::getPageMode (
void
): string

Get the page mode.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See
  • PDF 32000-1:2008 - 7.7.2 Document Catalog

getPages()

Get a pages object from the document.

getPermissions()

Get the permission object.

getStructTreeRoot()

Get the documents structure tree root object.

getVersion()

public Catalog::getVersion (
void
): ?string

Get the value of the Version entry of the catalog dictionary.

This value defines the version of the PDF specification to which the document conforms if later than the version specified in the file's header.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getViewerPreferences()

Get a viewer preferences object.

setBaseUri()

public Catalog::setBaseUri (
?string $uri
): void

Set the base URI.

Parameters
$uri : ?string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See

setLang()

public Catalog::setLang (
string $lang,
string $encoding = 'UTF-8'
): void

Set the language identifier.

Parameters
$lang : string
 
$encoding : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

setMetadata()

public Catalog::setMetadata (
string $metadata
): void

Set the metadata stream.

To remove the metadata just pass null to this method.

Parameters
$metadata : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

setOpenAction()

Set the open action.

The open action entry specifies a destination that shall be displayed or an action that shall be executed when the document is opened.

Additional document related actions could be get or set in the Catalog\AdditionalActions class that could be get with the getAdditionalActions() method.

Parameters
$openAction : \SetaPDF_Core_Document_Destination|\SetaPDF_Core_Document_Action|null
 
Exceptions

Throws \InvalidArgumentException

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

setPageLayout()

public Catalog::setPageLayout (
?string $pageLayout
): void

Set the page layout.

Possible values are declared as class constants in the PageLayout class.

Parameters
$pageLayout : ?string

The name of the page layout

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See

setPageMode()

public Catalog::setPageMode (
?string $pageMode
): void

Set the page mode.

Possible values are declared as class constants in the PageMode class.

Parameters
$pageMode : ?string

The name of the page mode

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

See

setVersion()

public Catalog::setVersion (
?string $version
): void

Set the version of the PDF specification to which the document conforms.

Parameters
$version : ?string
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception