Repetitive tasks are the most common reason for using AcroJS. AcroJS allows you to automate tasks that you do manually time and time again, for example you could write some AcroJS that is part of a Batch Sequence to add a series of Bookmarks to a folder of PDF documents.
If you have created some PDF Forms and want to ensure your users enter only valid data then you could use AcroJS to validate and control the data entered. For example you could make use of Regular Expressions to validate a Social Security Number or an Email Address (link to new article).
If you have a full version of Acrobat (v5, v6 Std, v6 Pro) we can make use of Templates to create a dynamic PDF. Templates (link) provide a way to dynamically add marked elements to a pre-existing PDF, elements such as graphics, form fields and text.
The Acrobat Document Object Model (ADOM)
Each diagram illustrates the hierarchy of objects in each respective environment.
Form field level
Document level scripts reside inside the PDF and are available and accessible to all other elements and scripts in the PDF. (links)
Page level scripts arenít accessible by/from any other elements and can be one or both of the following types: Page Open Action or Page Close Action. (links)
AcroJS placed at the form field level can be placed in various locations:
Event triggered Script
As you can see AcroJS at the Form Field level provides a great number of choices.
When you need to run a script thatís activated when you click a Bookmark or a Link then Acrobat provides this functionality as well.
Limitations and Possibilities
OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.