JavaScript Support in Forms
Revu eXtreme® allows the use of JavaScripts in PDFs when this option is enabled in the Preferences (see JavaScript Preferences). Scripts can be run on PDFs (see Using Scripts) or added as a Form action. This allows form fields to invoke stored JavaScripts from triggers, events, and actions.
Note: Functions related to creating and editing forms are only available in Bluebeam Revu eXtreme.
JavaScripts are stored at the document level (Global JavaScripts) and are executed when the document is loaded (opened). JavaScripts can be invoked from other parts of the document, such as actions, triggers, and events. Revu allows JavaScripts of up to 1 MB in size at a time.
To add, edit, or delete JavaScripts:
- Open the desired PDF.
- Go to Tools > Form > JavaScript. The Global JavaScript dialog box appears.
- To add a new JavaScript, click Add to bring up the JavaScript Editor. Enter a name for the JavaScript in the Name field and the script in the Code field, then click OK.
- To edit an existing JavaScript, select it and click Edit to bring up the JavaScript Editor. Make the desired changes to either the Name or the Code and click OK.
- To delete a JavaScript, select it and click Delete.
JavaScripts are used in Forms as actions that are triggered by specific events. See Form Properties: Actions for more information.
Multiple JavaScripts can be added to a PDF, but be aware that they will be executed in order and, once inserted, cannot be moved. Consider the desired order of execution of all JavaScripts before adding any, if multiple JavaScripts are to be used.