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
| Index | The 1-based form-field index |
|---|---|
| EventName | The trigger event name, such as MouseUp, MouseDown, MouseEnter, MouseExit, Focus, LostFocus, KeyPress, BeforeFormatting, Change, or Calculate |
| ActionKind | One of the PDF_ACTION_BUILDER_* constants supported by AddActionNextEx |
| Value | The URI, named action, JavaScript source, import-data file name, or unused value for destination actions |
| FieldNames | A comma-separated field list for hide, submit, and reset actions |
| Flags | Action-specific flags or the 1-based thread index for PDF_ACTION_BUILDER_THREAD |
| DestID | The destination handle for PDF_ACTION_BUILDER_DESTINATION, or a 1-based bead index for PDF_ACTION_BUILDER_THREAD with 0 selecting the first bead |
Return values
| 0 | The field, event name, action kind, or required value was invalid or PDF/X-6 mode is active |
|---|---|
| 1 | The 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, destination or article Thread action Form-field additional actions are rejected while PDF/A or PDF/X-6 mode is active because both profiles prohibit field and widget
/AA dictionaries even when the selected action type is otherwise permitted