Nitro PDF Professional: Create and change PDFs with the original Acrobat alternative.


Download the 14-day free trialBuy online now


Copying and pasting JavaScripts

JavaScripts can be copied and pasted from one field or other location in a PDF document or between two documents. If you examine PDF files for learning JavaScript programming, you can browse PDF files containing scripts, copy a script from a document you download from the Internet, and paste the code into the JavaScript Editor in your document. With a little code modification, you can quickly add scripts to your own files.

To copy and paste a script from one file to another:

  1. Open a document containing a JavaScript.
  2. Open the item where the JavaScript is found. In many cases you can find scripts in a text field Calculate properties.
  3. Click Edit JavaScript.
  4. Press Control + A in the JavaScript Editor to select all the code.
  5. Open a context menu and select Copy.
  6. Open a file where you want to add the JavaScript.
  7. Open a text field Calculate properties (or other location where you originally copied the script) in another PDF document and click Set Action. Select Run JavaScript from the Select Action drop down menu and click Add.
  8. Open a context menu in the JavaScript Editor and select Paste.
  9. Click OK.