DynaPDF Manual - Page 118

Previous Page 117   Index   Next Page 119

Function Reference
Page 118 of 818
AddActionToObj
Syntax:
SI32 pdfAddActionToObj(
const PPDF* IPDF, // Instance pointer
TObjType ObjType, // The type of object that should get the action
TObjEvent Event,
// Which event should trigger the action
UI32 ActHandle,
// Action Handle
UI32 ObjHandle)
// Object Handle (see notes below)
typedef enum
{
otAction,
otAnnotation,
otBookmark,
otCatalog,
// PDF 1.4
otField,
otPage,
otPageLink
}TObjType;
typedef enum
{
oeNoEvent,
// Internal use only -> DO NOT USE THIS VALUE!!!
oeOnOpen,
// Catalog, Pages
oeOnClose,
// Pages only
oeOnMouseUp,
// All fields, page link annotations, bookmarks
oeOnMouseEnter,
// Form fields only
oeOnMouseExit,
// Form fields only
oeOnMouseDown,
// Form fields only
oeOnFocus,
// Form fields only
oeOnBlur,
// Form fields only
oeOnKeyStroke,
// Text fields only
oeOnFormat,
// Text fields only
oeOnCalc,
// Text fields, combo boxes, list boxes
oeOnValidate,
// All form fields, except buttons
oeOnPageVisible,
// PDF 1.5 -> Form fields only
oeOnPageInVisible, // PDF 1.5 -> Form fields only
oeOnPageOpen,
// PDF 1.5 -> Form fields only
oeOnPageClose,
// PDF 1.5 -> Form fields only
oeOnBeforeClosing, // PDF 1.4 -> Catalog, must be a JavaScript Action
oeOnBeforeSaving,
// PDF 1.4 -> Catalog, must be a JavaScript Action
oeOnAfterSaving,
// PDF 1.4 -> Catalog, must be a JavaScript Action
oeOnBeforePrinting,// PDF 1.4 -> Catalog, must be a JavaScript Action
oeOnAfterPrinting
// PDF 1.4 -> Catalog, must be a JavaScript Action
}TObjEvent;
This function adds an action to a PDF object. The parameter ActHandle requires a handle that was
returned by a function that creates an action object such as CreateGoToAction(), etc. The object
handle is also a return value of its creation function. If the object type is a page, then use the page
number as handle.
It is possible to add multiple actions to one object, but note that DynaPDF does not check whether
all actions are valid. For example, it is possible to add more than one action to a text field to the
OnFormat event, but Acrobat executes only the first one. Always test your actions with different
Acrobat versions because each version handles actions in a different manner.
The OnMouseUp event is the standard event supported by all objects. This event type supports also
all action types. The other events are handled differently depending on the Acrobat version. Acrobat
 

Previous topic: Function Reference, Abort (Rendering Engine), ActivateAltFontList

Next topic: AddAnnotToPage, AddArticle


Start Chat