SetaPDF_Core_Document_Catalog_OptionalContent Class for handling optional content

File: /SetaPDF/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 null|SetaPDF_Core_Type_Array SetaPDF_Core_Document_Catalog_OptionalContent::_getArrayFromDefaultViewing ( string $name [, boolean $create = false ] )

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

Parameters
$name : string
 
$create : boolean
 

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
 

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
 
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
 

cleanUp()

Release resources / cycled references.

getAsArray()

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

Parameters
$create : boolean
 
See
  • PDF 32000-1:2008 - 8.11.4.3 Optional Content Configuration Dictionaries

getBaseState()

Get the base state from the default viewing dictionary.

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

getDefaultViewingDictionary()

Get the default viewing dictionary.

Parameters
$create : boolean
 
See
  • PDF 32000-1:2008 - 8.11.4.2 Optional Content Properties Dictionary

getDocument()

getGroup()

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

Get a group by its name.

Parameters
$name : string

The group name

$encoding : string

The input encoding

getGroups()

getIterator()

Implementation of IteratorAggregate.

A separate iterator is needed to receive SetaPDF_Core_Document_OptionalContent_Group objects while iterating.

See

getOffArray()

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

Parameters
$create : boolean
 
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
 
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
 

getOrderArray()

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

Parameters
$create : boolean
 
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
 

setBaseState()

Set the base state in the default viewing dictionary.

Parameters
$baseState : string
 
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
 

setOn()

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

Parameters
$group : SetaPDF_Core_Document_OptionalContent_Group