Use JavaScript

You can add custom JavaScript actions to your PDF files.

Disable JavaScript if it is creating undesired actions in PDF files you receive, or to respect compliance requirements.

To enable or disable JavaScript in the program, go to File > Options > JavaScript.

To access JavaScript settings, select Edit > Tools.

Add JavaScript actions to PDF document events

  1. Select Set Document Actions.
  2. Select the Document event in the left window.
  3. Click Edit.
  4. Write your JavaScript in the JavaScript Editor text window.
  5. Repair any reported syntax errors and click OK again.
  6. Click OK.

Edit your script directly

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

Create custom scripts

  1. Select 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.

Email the PDF that you have just saved

JavaScript actions may be vulnerable to malware attacks.

  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 email message appears with your PDF attached to it.