AddActionNextJavaScript
JavaScript, Annotations and hotspot links
Description
Appends a JavaScript next-action to an existing annotation, outline, or form-field action
Syntax
Delphi
Function TPDFlib.AddActionNextJavaScript(ActionID: Integer; Const JavaScript: WideString): Integer;
DLL
int DLAddActionNextJavaScript(int InstanceID, int ActionID, const wchar_t * JavaScript);
Parameters
| ActionID | An ActionID as returned by GetAnnotActionID, GetOutlineActionID, or GetFormFieldActionID |
|---|---|
| JavaScript | The JavaScript source to execute after the primary action |
Return values
| 0 | The ActionID was invalid, the JavaScript string was empty, or the selected document is in PDF/A mode |
|---|---|
| 1 | The JavaScript next-action was appended successfully |
Remarks
The function writes the PDF action /Next entry without replacing the primary action, preserving any existing chained actions
Use GetActionNextCount and GetActionNextInfo to inspect the chained actions after creation or after loading an existing PDF