DynaPDF Manual - Page 268

Previous Page 267   Index   Next Page 269

Function Reference
Page 268 of 770
to the function. However, the function must be able to distinguish between both string formats. To
achieve this, the parameter Handle accepts the special flag 0x10000000 that specifies that the
parameter Colorant contains a UTF-8 encoded string. The flag must be combined with the handle as
handle |= 0x10000000;
// C/C++, C#
= handle Or &H10000000 // Visual Basic
handle := handle or $10000000
// Delphi
If the alternate color space is a device color space, simply set the parameter to 0x10000000 to specify
that the colorant name is a UTF-8 string.
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().
Return values:
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.
SI32 pdfCreateSetOCGStateAction(
const PPDF* IPDF, // Instance pointer
UI32* On,
// Array of OCG handles which should be set to On
UI32 OnCount,
// Number of OCGs handles in the On array
UI32* Off,
// Array of OCG handles which should be set to Off
UI32 OffCount,
// Number of OCG handles in the Off array
UI32* Toggle,
// 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.

Previous topic: Encoding of Colorant Names

Next topic: CreateSigField, How to lock an Interactive Form after signing?