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

DynaPDF Manual - Page 262

Previous Page 261   Index   Next Page 263

Function Reference
Page 262 of 750
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
follows:
handle |= 0x10000000;
// C/C++, C#
handle
= 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.
Notice:
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.
Remarks:
Use the function SetExtColorSpace() to activate the color space in the graphics state. To set a color of
a Separation space pass the whished 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.
CreateSetOCGStateAction
Syntax:
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: How to lock an Interactive Form after signing?