DynaPDF Manual - Page 134

Previous Page 133   Index   Next Page 135

Function Reference
Page 134 of 787
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
LBOOL pdfAddOCGToAppEvent(
const PPDF* IPDF,
// Instance pointer
UI32 Handle,
// OCG handle
TOCAppEvent Events,
// Bitmask, see below
TOCGUsageCategory Categories) // Bitmask, see below
typedef enum
aeExport = 1,
= 2,
= 4
The categories refer to the members of a Content Usage dictionary. See SetOCGContUsage() for
further information.
typedef enum
= 0,
= 1,
oucLanguage = 2,
= 4,
= 8,
= 16,
= 32
The function adds an Optional Content Group (OCG) to an application event. PDF defines three
events, in which the state of layers or OCGs can be dynamically changed depending on settings in
Content Usage Dictionaries, which are associated to OCGs. A Content Usage dictionary must be
created or added to an OCG with SetOCGContUsage() before this function can be called.
The Content Usage dictionary can define multiple settings which control the visibility state, e.g. the
wished Export and Print state. The parameter Categories is a bitmask, so that more than one category
can be used in a specific event. The parameter Event is a bitmask too, so that the OCG can be added
to multiple events in just one function call.
The function makes sure that only valid categories can be added to a specific event. If the Content
Usage dictionary contains no settings for a specific category, then this category will be masked out
from the parameter Categories. If no more category remains then the OCG will not be added to the

Previous topic: AddMaskImage, AddObjectToLayer

Next topic: AddOutputIntent

Start Chat