DynaPDF Manual - Page 287
Previous Page 286 Index Next Page 288
Page 287 of 821
Non-device color spaces cannot be used for interactive objects such as annotations or form fields.
The active color space must always be changed to a device color space before creating interactive
objects; see SetColorSpace(). Note also that annotations support DeviceRGB only. Form fields
support DeviceGray, DeviceRGB, and DeviceCMYK.
Use the function SetExtColorSpace() to activate the color space in the graphics state. To set a color of
a Separation space pass the wished color value to SetFillColor(), SetStrokeColor(), or SetColors().
If the function succeeds the return value is the color space handle, a value greater or equal zero. If
the function fails the return value is a negative error code.
const PPDF* IPDF, // Instance pointer
// Array of OCG handles which should be set to On
// Number of OCGs handles in the On array
// Array of OCG handles which should be set to Off
// Number of OCG handles in the Off array
// Array of OCG handles which should toggle the state
UI32 ToggleCount,// Number of OCG handles in the Toggle array
LBOOL PreserveRB) // Preserve radio button relationships if any?
The function creates a SetOCGState action that can be used to change the visibility state of certain
Optional Content Groups (OCGs). All arrays of OCG handles are optional but at least one array
must be provided. The parameter PreserveRB should be set to true to preserve radio button state
relashionships, if any. If set to false, radio button state relashionships will be ignored when setting
the visibility state of affected OCGs.
Actions must be added to a PDF object so that they can be executed. See AddActionToObj() for
further information and the example on the next page.
If the function succeeds the return value is the action handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
This example creates a document in two languages. The text for the different languages is placed
when opening the file. It is also possible to change the language with two bookmarks. The
Previous topic: Encoding of Colorant Names
Next topic: CreateSigField, How to lock an Interactive Form after signing?