Tutorials, tools, scripts and samples for scripting Acrobat and PDFpdfscripting.com
HomeVideo TutorialsCopy-n-Paste ScriptsDownload LibraryFree ContentSearchMEMBERS LOG-IN
Home | Automating Acrobat
 

Automating Acrobat can save you loads of time.

Automation is the process of simplifying a task through some kind of programming mechanism. Ideally this means creating a single toolbar button or menu item that completes the task in one go. Nearly any task that can be done with Acrobat can be automated, so any task that has to be performed repeatedly is ripe for automation. These tasks range from the absurdly simple to the insanely complex. For example, there are certain documents (such as the Acrobat JavaScript Reference) that I use daily. So I've added items to the Acrobat Help menu to open these files. Simple, but well worth it since these docs are used frequently. On the other end, I had a client that needed the same document to be stamped with individual customer info, secured, and then emailed to the customer. The customer information and emails were in an Excel spreadsheet. Since there were hundreds of entries, performing this task manually could take days; entry of the customer data would probably result in some errors; and there would probably be style differences in how the data was entered into the individual stamps. The automation script ran the entire process in a few minutes, data was transcribed exactly, and it was done the same way every time. Automating a task can take up time you might think is better spent manually performing the task. But this way of thinking is usually misguided. Automation can have profound benefits, and here's a list of the most obvious ones.

Advantages

  • Performance - Some tasks that take hours can be reduced to minutes.
  • Efficiency - The number of steps to complete a task are reduced.
  • Consistency - Operations are performed in the same way every time.
  • Elimination of errors - Human error is the biggest problem with manual entry.
  • Eliminates having to remember or look up complex manual actions.
  • Simplified training - It's much simpler to train an employee or customer to press a single button than to become experts with Acrobat.

There are several different ways to Automate Acrobat.
  • Actions/Batch Processing
  • Folder Level JavaScript
  • External Program through the IAC
  • Plug-in
  • Combination - Mix and Match methodologies

Actions (old Batch Processing)

Only available in Acrobat Professional. Used to be called Batch processing, changed to Actions in Acrobat X. Actions are a way to apply a series of commands to one or more files and is the type of automation accessible to the largest number of users since it does not require scripting. Acrobat's Action wizard provides a set of predefined commands that the user can choose from to build a custom sequence. These commands are almost exactly the same operations that can be applied manually from the regular Acrobat Tools. But one of the commands is "Run a JavaScript" which adds extra flexibility to what can be done with an Action. The JavaScript commands that can be used in an Action are nearly the same as what can be used in a trusted function.

Folder Level JavaScript

Folder level scripts are JavaScript files (.js) that are placed in one of the two Acrobat JavaScript Folders. Acrobat loads and runs these files at start up. At this time, the scripts in these files are given special privileges so they can run any functions and access any properties in the Acrobat DOM. The idea with such a file is that it will preform a series of setup activities such as creating variables, data, functions, and user interface items such as toolbar buttons or menu items. Basically, setting up an automation tool.

Automation tools created through a folder level script will be the main focus of the topics in this department. However, nearly all of the topics will also be valid for scripts used in Actions.

IAC, Inter-Application Communication

The IAC is a programming interface that allows Acrobat to be controlled from an external application, usually either Visual Basic or AppleScript. This is a very powerful way to create automation tools that have both total system access and access to all the Acrobat tools. But since this tool is platform dependent and requires the user to have special development tools, it will not be a focus here.

Acrobat Plug-ins

Acrobat plug-ins are written in C++ and are by far the most powerful way to automate Acrobat. They have deep access into the internals of both Acrobat and PDF. They are also platform dependent and difficult to create. The developer requires expert knowledge of Acrobat, the PDF structure, and C++ programming. This topic is currently outside the scope of this web site.

Combination

When the limitations of one automation technique get in the way, any of these methods can be combined with any other to create hybrid solutions. There are also methods that are not mentioned here, such as Acrobat's browser interface, using server-side tools, and 3rd party tools. There are a wide range of possibilities when it comes to creating automation solutions for PDF.

Parts of an Automation Tool

I've been doing this for years and it is extremely rare that the same automation task comes up twice. Everyone has their own way of using Acrobat, and their own unique need for automation, which is why it's a custom programming task. However, automation scripts do share many common characteristics. All scripts require some kind of user interface, i.e., a way to activate the tool and enter any setup parameters. All scripts require access to the same functionality available from the Acrobat menu items and toolbars. And finally, many automation tasks will require access to external resources, such as a database or the internet. These items divide up nicely into two categories-- User Interface and Business Logic.

The articles listed below cover topics directly important to Automation Scripting. Some are generally useful to automation, such as the one on Page Coordinates, and some are on specific automation activities, such as the one one on Importing and Exporting Excel File Data.

How to use a menu item from a script
Thom Parker
Learn how to use the Acrobat menu items in your scripts. Menu items can be used to access functionality not available to a script and also as shortcut to performing some tasks. This technique is more handy than you might think because Acrobat has many more menu items than are displayed on the user interface. In fact, Acrobat has a menu item for almost every feature. . . . keep reading
Using Trusted Functions
automation
Why Trust? As the internet has become more popular, it has also become more dangerous. In order to protect Acrobat users from malicious documents Adobe has added new . . . keep reading
Trust and Privilege in Acrobat Scripts
automation, folder
There are several scripting functions and properties that pose security risks in Acrobat and Reader. These are however, some of the most useful operations for creating automation scripts. This article covers the security concepts in Acrobat relevant to scripting, and ways to perform these risky operations. . . . keep reading
Custom Dialogs in Acrobat JavaScript
Thom Parker
Dialog boxes are a must have feature for any Acrobat Script where complex user input is needed, such as dynamic stamp scripts and folder level automation tools. It's a good thing for us then, that Acrobat provides a way to create custom dialogs. However, this is not an easy task. These 3 video tutorials provide an introduction into creating and using Custom Popup Dialog Boxes for Acrobat JavaScript. . . . keep reading
Exporting a Digital ID to Another Computer
Signature, Security, stamp
Digital ID's are typically very private and kept in a single secure location. But, there are workflows where it is necessary to share a Digital ID between several systems. For example, where a small set of users in a closed environment need to be able to decrypt the same documents, or for a single user who uses multiple systems (work station, laptop, etc.). This article covers transferring a Digital ID to another computer. . . . keep reading
Auto-Populating Form Fields from a Drop-Down List(ComboBox)
AcroForm, Field, Event,Data, List
Scripts and techniques for setting the values of form fields automatically from a selection on a drop-down list. . . . keep reading
LiveCycle Scripting: Connecting a Form to a Database
Database, Data Handling, XFA, Automation
LiveCycle PDF forms have a built-in ability to connect to a database through OLE DB drivers. While it can be extremely useful to have a direct connection between a form and an . . . keep reading
Acquiring Raw File Data
Thom Parker
External data, i.e., data outside of Acrobat or a PDF file, is often a very important part of a workflow process. For example, information on customers, products, employees, etc. are typically stored in Excel files, databases or on a server. One of the most common issues with automating such a workflow process is getting the data from the external file or data source into the automation script. This article provides techniques and script examples for acquiring external data. . . . keep reading
Creating Acrobat Toolbar Buttons
Automation, User Interface
Toolbar buttons are the most important user interface items for activating Acrobat Automation Scripts, but they are also useful in many other ways. This article covers the details of creating toolbar buttons, toolbar button icons, and hooking them into automation scripts. . . . keep reading
Using the Mouse to Automate Stamps
Stamps, Automation, Annotations
Capturing and using mouse clicks for an automation script can be awkward to implement. But, it is an ideal solution for many user-driven processes. This article covers the implementation details for using the mouse to place stamps. . . . keep reading
Automating Stamps
Stamps, Automation, Annotations
This article covers the details of placing stamp annotations on a PDF page with JavaScript. . . . keep reading
Anatomy of a Stamp File
All of the stamps in Acrobat, built-in or custom, are stored in a set of Stamp Files. When you create a new custom stamp, Acrobat either adds this stamp to one of the existing Stamp Files or creates . . . keep reading
Setting Up an Excel File for Database Access
Database, Data Handling, Automation
Relational database access assumes a very specific table structure. The database contains named lists of records (Tables). Each column in a table is named and typed. Excel is not really a databa . . . keep reading
Importing and Exporting Excel Data
Automation, Excel, Database, AcroForm
This article explains exactly how to transfer data, in both directions, between an excel file and Acrobat. Scripts are provided for importing and exporting in a variety of scenarios, including a looping scenerio for performing variable data operations and mail merge. . . . keep reading
Using Excel™ with Acrobat™, PDF, and LiveCycle
Automation, Data Handling, XFA
There are several different ways Acrobat, PDF, and LiveCycle forms can exchange data with an Excel Spreadsheet. This series of articles outlines the details of the different methodologies and provides several variations on the code for implementing each. . . . keep reading
PDF Page Coordinates (page size, field placement, etc.)
AcroForm, Basics, Automation
Page coordinates are used to add fields and annotations to a page, move fields and annotations, resize page boundries, locate words on a page, and for any other operation that involves page geomet . . . keep reading
More HeadlinesMore Headlines