SetaPDF_Core_Document_Catalog_OptionalContent Class for handling optional content
File: /SetaPDF v2/Core/Document/Catalog/OptionalContent.php
Class hierarchy
Implements
Summary
Methods
- __construct()
- _getArrayFromDefaultViewing()
- _setOnOrOff()
- addGroup()
- addUsageApplication()
- appendGroup()
- cleanUp()
- getAsArray()
- getBaseState()
- getDefaultViewingDictionary()
- getDocument()
- getGroup()
- getGroups()
- getIterator()
- getOffArray()
- getOnArray()
- getOptionalContentPropertiesDictionary()
- getOrderArray()
- prependGroup()
- setBaseState()
- setOff()
- setOn()
Constants
STATE_OFF
State constant
STATE_ON
State constant
STATE_UNCHANGED
State constant
Properties
$_propertiesDictionary
The optional contents properties dictionary
Methods
__construct()
The constructor.
Parameters
- $catalog : SetaPDF_Core_Document_Catalog
_getArrayFromDefaultViewing()
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
_setOnOrOff()
Parameters
- $group : SetaPDF_Core_Document_OptionalContent_Group
- $on : bool
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
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
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
getGroup()
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
getGroups()
Get all available content groups.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getIterator()
Implementation of IteratorAggregate.
A separate iterator is needed to receive SetaPDF_Core_Document_OptionalContent_Group
objects while iterating.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
See
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
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
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
setOn()
Set the default state of the optional content group to on.
Parameters
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception