When I started learning JavaScript for Adobe Acrobat Pro more than 20 years ago, and using it to program fillable forms and paperwork automation solutions, I was frequently led to the same place: The JavaScript forum at AcrobatUsers.com. Solutions and sample scripts were shared freely by true professionals, and masters of their craft.
It wasn’t long before I started answering questions myself and quickly moved into the expert rank. I got really busy with my business and the Acrobat Users website changed something procedurally in a negative way - I can’t even remember what it was - so I stopped answering questions. I recently started answering questions again.
A lot of answers start with "Create a document level script…" and it’s not long before the inevitable follow-up question "where does the document level script go?" surfaces. So here we go.
Get the course above, and a suite of automation tools for FREE with a Professional subscription.
Acrobat JavaScript Locations
There are several locations to insert and run JavaScript:
The JavaScript console: runs immediately when executed from the console.
The Action Wizard (formerly "Batch Process"): runs when an action runs.
Folder level script: runs every time the Acrobat program starts.
Document level script: runs every time a PDF opens.
Page action: runs when the user enters or exits a PDF page.
Document action: runs during one of the following events: before the user saves the document, after the user saves the document, before the user prints the document, after the user prints the document.
Form field: runs when user interacts with the form field, or when the value of another field changes.