DynaPDF Manual - Page 298

Previous Page 297   Index   Next Page 299

Function Reference
Page 298 of 839
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 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.
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.
Return values:
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.
Example (C++):
This example creates a document in two languages. The text for the different languages is placed
into separate layers. A JavaScript Action selects the correct layer depending on the viewer language
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?