Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 419

Previous Page 418   Index   Next Page 420

Function Reference
Page 419 of 750
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.
If the OCG is also included in an application event, this is the case if AppEvent is non-zero, then the
Content Usage dictionary is used to control the visibility state of the layer. The member Categories
specifies which categories control the visibility state.
 

Previous topic: GetObjEvent

Next topic: GetOCGContUsage