SetFormFieldActionEx

Form fields, Annotations and hotspot links

Description

Builds and assigns a form-field trigger action by using an event name and a named action builder constant

Syntax

Delphi

Function TPDFlib.SetFormFieldActionEx(Index: Integer; Const EventName: WideString; ActionKind: Integer; Const Value, FieldNames: WideString; Flags, DestID: Integer): Integer;

Parameters

IndexThe 1-based form-field index
EventNameThe trigger event name, such as MouseUp, MouseDown, MouseEnter, MouseExit, Focus, LostFocus, KeyPress, BeforeFormatting, Change, or Calculate
ActionKindOne of the PDF_ACTION_BUILDER_* constants supported by AddActionNextEx
ValueThe URI, named action, JavaScript source, import-data file name, or unused value for destination actions
FieldNamesA comma-separated field list for hide, submit, and reset actions
FlagsAction-specific submit or reset flags, or the hide flag for visibility actions
DestIDThe destination handle for PDF_ACTION_BUILDER_DESTINATION

Return values

0The field, event name, action kind, or required value was invalid
1The action was built and assigned to the selected field event

Remarks

This helper combines event-name resolution with action construction, which avoids separate temporary action handles when a field event only needs a direct URI, JavaScript, hide, submit, reset, import-data, named, or destination action