SetFormFieldActionA

Form fields, Annotations and hotspot links

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to SetFormFieldAction and string arguments are interpreted using the current SetAnsiMode code page

Binds an existing action dictionary to a form-field trigger

Syntax

Delphi

Function DLSetFormFieldActionA(InstanceID, Index: Integer; ActionType: PAnsiChar; ActionID: Integer): Integer;

DLL

int DLSetFormFieldActionA(int InstanceID, int Index, const char * ActionType, int ActionID);

Parameters

IndexThe 1-based form-field index
ActionTypeThe trigger name: E, X, D, U, Fo, Bl, K, F, V, or C
ActionIDAn action handle returned by GetAnnotActionID, GetOutlineActionID, or GetFormFieldActionID

Return values

0The field, trigger, or action handle was invalid
1The 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