DynaPDF Manual - Page 465

Previous Page 464   Index   Next Page 466

Function Reference
Page 465 of 839
GetOCG
Syntax:
LBOOL pdfGetOCG(
const PPDF* IPDF,
// Instance pointer
UI32 Handle,
// OCG handle or array index
struct TPDFOCG* Out) // See below
struct TPDFOCG
{
UI32
StructSize;
// Must be set to sizeof(TPDFOCG)
UI32
Handle;
// Handle or array index
UI32
Intent;
// Bitmask -> TOCGIntent -> Intent and visibility state
const char* NameA;
// Layer name
const UI16* NameW;
// Layer name
LBOOL
HaveContUsage; // If true, the layer contains a Content Usage dictionary.
// -> GetOCGContUsage().
// The following two members can only be set if HaveContUsage is true.
UI32
AppEvents;
// Bitmask -> see TOCAppEvent. If non-zero, the layer is included in
// one or more app events which control the layer state.
UI32
Categories;
// Bitmask -> see TOCGUsageCategory. The Usage Categories which
// control the layer state.
};
typedef enum
{
aeExport = 1,
aePrint
= 2,
aeView
= 4
}TOCAppEvent;
typedef enum
{
oucNone
= 0,
oucExport
= 1,
oucLanguage = 2,
oucPrint
= 4,
oucUser
= 8,
oucView
= 16,
oucZoom
= 32
}TOCGUsageCategory;
typedef enum
{
oiDesign
= 2,
oiView
= 4,
oiAll
= 8,
oiEmpty
= 16,
oiVisible = 32
// If set, the layer is visible
}TOCGIntent;
The function returns the properties of an OCG, also called layer. An OCG handle is a simple array
index. You can loop over all available OCGs from 0 to GetOCGCount() - 1.
The visibility state is encoded in the member Intent. The layer is visible if the the flag oiVisible is set.
If the member HaveContUsage is true, the OCG contains a Content Usage dictionary. The contents of
this dictionary can be accessed with the function GetOCGContUsage(). A Content Usage dictionary
contains additional information about a layer or OCG.
 

Previous topic: GetObjEvent

Next topic: GetOCGContUsage