
GetArray, checkThisBox, isBoxChecked, getItemAt, setItems, clearItems, setItems, insertItemAt, deleteItemAt, setAction, buttonImportIcon Value, rc, selStart, selEnd, willCommit, target, change, name, type Transparent, black, white, red, green, blue, cyan, magenta, yellow, dark gray, gray, light gray GetField, removeField, mailDoc, getNthFieldName, resetForm, print Please contact support if you run into issues or limitations. We therefore advise you to test your JavaScript-enabled documents thoroughly. ℹ️ Note: Each of the methods listed below may support only a subset of the features and parameters detailed in the specification. PSPDFKit has basic support for the most common JavaScript API methods and properties, detailed below. This effectively means that, by means of a corresponding link annotation, any other annotation type can trigger a JavaScript action on click as well. Link annotations can be laid on top of any existing annotation. PSPDFKit for Web supports running JavaScript actions from the following triggers. Example of How to Create a JavaScript-Enabled PDF Document Using Adobe Acrobat Supported Triggers A calculation action is invoked after certain events, like setting a form field value, and lets you establish relationships between form elements and perform calculations. A validation action validates the contents of a form field, ensuring they are always correct. A format action modifies the appearance of a form element so that its contents are shown in a particular way (like a date or time or the number of decimal places). One interesting set of JavaScript actions is that of the format, validation, and calculation actions. Click on the Actions tab and choose Run a JavaScript from the Select Action dropdown box. Open the Prepare Form tool and double-click on a form field. You can set regular action scripts in Adobe Acrobat too. For more information about PDF actions, read our PDF actions guide. You can initialize a with a script and associate it with a form element and a particular trigger event. A JavaScript action is represented by the class JavaScriptAction.

For more information about document-level scripts, read the Doc/Open subsection on page 363 of the JavaScript™ for Acrobat® API Reference guide.Īction Scripts: Form fields and annotations can be extended with JavaScript actions.

This includes Adobe Reader, Foxit Reader, and Firefox.This code snippet will get a reference to the form field with the name MyTextField in the document.ĭocument-level scripts are useful for reusing information and functions that will be accessed from several action scripts. Note that only some PDF readers can view attachments.
