The JavaScript language, developed by Netscape Communications, lets you create interactive web pages with more ease. ZEON has enhanced JavaScript language and integrated it into PDF Plus so you that can use JavaScript to calculate, format, or validate user data, along with assigning actions, controlling document behaviors, and processing multiple PDF documents in batch sequences.

Choose Document > JavaScript, and do the following to add custom JavaScript to your PDF documents.

To add JavaScript actions to PDF document events:

  1. Choose Set Document Actions.
  2. In the Set Document Actions window, select a document event.
  3. Click the Edit button.
  4. Write your JavaScript in the JavaScript Editor console.
  5. Click OK and close the window.

To edit your script directly:

  1. Choose JavaScript Console.
  2. Compile your script.

To create custom JavaScripts:

  1. Choose Document JavaScripts.
  2. Click Add.
  3. Name your script for identification and click OK.
  4. Click Edit and compile your script. When done, click OK.
  5. Click Close to finish.

Provided that your script is correct, and it is supported by the version of your PDF, the set event will execute the specified action.

Example – E-mailing the PDF that you have just saved:

  1. Select Document Save Completed in the Set Document Actions dialog.
  2. Click Edit.
  3. Type in the following script: this.mailDoc(true);
  4. Click OK.

After you have successfully saved the PDF, a new blank e-mail message will pop-up with your PDF attached to it.

To assign the Run a JavaScript action:

  1. Open the Properties dialog box of a bookmark, a link or a form field, and click Actions tab.
  2. Select Run a JavaScript from the Select Action menu, and then click Add.
  3. In the pop-up JavaScript Editor window, create and edit JavaScript to realize specific effects. Select Go To to input the line number. Click Ok.
  4. Click Close.

Note: Free PDF reader users may not have access to run some custom JavaScripts, causing the form to function abnormally. To avoid this, add dditional usage rights.

Using Custom JavaScript