SetaPDF_Core_Document_Catalog_OptionalContent Class for handling optional content

File: /SetaPDF v2/Core/Document/Catalog/OptionalContent.php

Class hierarchy

Implements

Summary

Constants

STATE_OFF

State constant

STATE_ON

State constant

STATE_UNCHANGED

State constant


Properties

$_catalog

$_propertiesDictionary


Methods

__construct()

_getArrayFromDefaultViewing()

protected SetaPDF_Core_Document_Catalog_OptionalContent::_getArrayFromDefaultViewing (
string $name [, boolean $create = false ]
): null|SetaPDF_Core_Type_Array

Get and/or create an array entry in the default viewing dictionary.

Parameters
$name : string
 
$create : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

addGroup()

This method adds a method to the OCGs array.

By adding a group with this method the group will not be added to the user interface.

Parameters
$group : SetaPDF_Core_Document_OptionalContent_Group|string
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

addUsageApplication()

Create and add usage application dictionaries for the given optional content group.

The usage definition in an optional content group will only apply to automatically adjustment if the group is referenced by a usage application dictionary.

$triangle = $optionalContent->appendGroup('Triangle');
// Define the usage
$triangle->usage()->setPrintState(SetaPDF_Core_Document_Catalog_OptionalContent::STATE_OFF);
// Now add it to an usage application dictionary
$optionalContent->addUsageApplication($triangle);
Parameters
$group : SetaPDF_Core_Document_OptionalContent_Group
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See

appendGroup()

Append an optional content group to the outline structure.

Parameters
$group : string|SetaPDF_Core_Document_OptionalContent_Group
 
$parent : SetaPDF_Core_Document_OptionalContent_Group
 
$afterIndex : integer|null
 
$nextToOrLabel : string|SetaPDF_Core_Document_OptionalContent_Group
 
$label : string
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

cleanUp()

Release resources / cycled references.

getAsArray()

Get and/or create the AS array in the default viewing dictionary.

Parameters
$create : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

getBaseState()

Get the base state from the default viewing dictionary.

Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

getDefaultViewingDictionary()

Get the default viewing dictionary.

Parameters
$create : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.2 Optional Content Properties Dictionary

getDocument()

getGroup()

public SetaPDF_Core_Document_Catalog_OptionalContent::getGroup (
string $name [, string $encoding = 'UTF-8' ]
): false|SetaPDF_Core_Document_OptionalContent_Group

Get a group by its name.

Parameters
$name : string

The group name

$encoding : string

The input encoding

Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

getIterator()

getOffArray()

Get and/or create the OFF array in the default viewing dictionary.

Parameters
$create : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

getOnArray()

Get and/or create the ON array in the default viewing dictionary.

Parameters
$create : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

getOptionalContentPropertiesDictionary()

Get and creates the optional content properties dictionary.

Parameters
$create : boolean
 
Exceptions

Throws SetaPDF_Core_Type_Exception

Throws SetaPDF_Core_SecHandler_Exception

getOrderArray()

Get and/or create the Order array in the default viewing dictionary.

Parameters
$create : boolean
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

prependGroup()

Prepends an optional content group to the outline structure.

If the $beforeIndex parameter is out of range the group will be appended.

Parameters
$group : string|SetaPDF_Core_Document_OptionalContent_Group
 
$parent : SetaPDF_Core_Document_OptionalContent_Group
 
$beforeIndex : integer|null
 
$nextToOrLabel : string|SetaPDF_Core_Document_OptionalContent_Group
 
$label : string
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

setBaseState()

Set the base state in the default viewing dictionary.

Parameters
$baseState : string
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

setOff()

Set the default state of the optional content group to off.

Parameters
$group : SetaPDF_Core_Document_OptionalContent_Group
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception

setOn()

Set the default state of the optional content group to on.

Parameters
$group : SetaPDF_Core_Document_OptionalContent_Group
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

Throws SetaPDF_Core_Type_Exception