DynaPDF Manual - Page 709

Previous Page 708   Index   Next Page 710

Function Reference
Page 709 of 770
The function creates or changes the Content Usage dictionary of an OCG. The structure must be
initialzed with InitOCGContUsage() before certain settings of it can be changed. Do not initialize the
structure with memset() since this would cause unexpected results!
If no members of the structure were changed after initialization then the Content Usage
dictionary of the OCG will be deleted, if it contained already one. Since a Content Usage
dictionary is required for OCGs which are included in an application event, the OCG will also be
deleted from all application events in which it was included.
The information in this dictionary serves as pure information as long as the OCG is not added to an
application event (see AddOCGToAppEvent() for further information).
PDF supports the following application events which can be used to control the visibility of an OCG
or layer:
Each event has corresponding categories or members in the Content Usage dictionary as well as
additional categories, which can be combined in with three events, e.g. the viewer language or the
current user.
A viewer, that supports these application events, will change the visibility state according to the
settings in the Content Usage dictionary.
Note that application events are not supported in all viewer applications. If a watermark should
appear when printing, for example, then it is usually best to set the state of such a layer to visible,
and to make it invisible in the View event. A viewer that supports application events will hide the
layer at viewing time but still print it. A viewer that does not support application events will always
display the layer.
If the initial state of the layer would be invisible, then it would also stay invisible at printing time if
the viewer does not support application events but layers.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: SetOCGContUsage

Next topic: SetOCGState, SetOnErrorProc