SetFormFieldAction
Form fields, Annotations and hotspot links
Description
Binds an existing action dictionary to a form-field trigger
Syntax
Delphi
Function TPDFlib.SetFormFieldAction(Index: Integer; Const ActionType: WideString; ActionID: Integer): Integer;
ActiveX
Function PDFlib::SetFormFieldAction(Index As Long, ActionType As String, ActionID As Long) As Long
Available on IPDFlibrary5 from type library version 3.6
DLL
int DLSetFormFieldAction(int InstanceID, int Index, const wchar_t* ActionType, int ActionID);
int DLSetFormFieldActionA(int InstanceID, int Index, const char* ActionType, int ActionID);
Parameters
| Index | The 1-based form-field index |
|---|---|
| ActionType | The trigger name: E, X, D, U, Fo, Bl, K, F, V, or C |
| ActionID | An action handle returned by GetAnnotActionID, GetOutlineActionID, or GetFormFieldActionID |
Return values
| 0 | The field, trigger, or action handle was invalid or PDF/X-6 mode is active |
|---|---|
| 1 | The action was copied and assigned to the field trigger |
Remarks
The action dictionary is copied into the selected document before it is assigned to the field, so later edits to the original action do not mutate the field trigger
Use ActionType U for the primary mouse-up activation action, matching the action read by GetFormFieldActionID(Index, 'U')
Use RemoveFormFieldAction to clear a trigger and GetFormFieldActionInfo to inspect the assigned action through TPDFlibActionInfo