Copy-n-Paste Script Library

Thom Parker

This is a collection of JavaScripts available for use in your PDF documents and forms. We have included a broad range of scripts to reflect most of the functions and methods available for use in Acrobat JavaScript, as well as frequently asked for scripts. This area is under constant development and new scripts will be added on a regular basis.

How to use the Copy-n-Paste scripts

1. Scripts are grouped into broad categories , which are further divided into general scripting topics. Clicking on a category link below will take you to a page listing the general topics within the category. (Example. Click on the "Document and Form Scripts" category below, then select a Topic on that page.
2. Each Topic page contains a general discussion of these types of scripts and ways they can be used, how the scripts work, and related resources on the site for learning more about how to use them.
3. Each individual script includes an information bar. The information bar contains very important usage information for each script including what field type it works best with, where to place the code, what version of Acrobat is applicable, and whether or not the script will work in Adobe Reader.
4. Each script has a set of 'orange" Show buttons labeled "How it Works" and "Code." The "How it Works" button describes how to use and modify the code, and the "Code" button displays a text box with the script for easy copy/paste into your own PDFs.


Hiding and Showing Form Fields

There are many scenarios where it is desirable to show and hide form fields on a PDF. A couple common scenarios are to keep the user focused on only those parts of the form they need to fill out, and... keep reading

Checkboxes and Radiobuttons

The details of these two extremely useful form elements are discussed here together because they are very similar. The share nearly all the same properties and options, and have all the same scripting properties and functions. In fact, there is really only one real difference between the two.... keep reading

JavaScript Compatibility

On this Site You'll find loads of JavaScript tools, samples, scripted download files, articles, and video tutorials. All created at different times in the life of Acrobat. However, they are all compat... keep reading

List Field Usage and Handling
list,dropdown,listbox

An introduction into scripting for the two types of PDF List fields. Includes links to samples as well as more advanced articles on scripting lists.... keep reading

How to run a menu item from a script
menu;common

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

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

Auto-Filling a Drop List with a Drop List
form, list

This article presents techniques and Scripts for automatically setting the list entries in a drop down (combobox) field from a selection in another drop down field. Includes sample files.... keep reading

Radio Button Events
AcroForm, Field, Event

Radio buttons have exactly the same events as all the form fields. These events are used when you need the radio button selection to drive some other action on the form. Two of the most common uses are scripting the MouseUp event to set a value in another field(s) and to Enable/Disable or Hide/Show other fields. But there are many others.... keep reading

Document Navigation Scripts
AcroForm, Navigation

Document navigation is the process of finding your way through content in a document. Documents are rarely read from start to finish. Unless the document is a novel, users will want to skip around to find the particular content they are interested in. This is especially true for interactive electronic documents, which are used more for providing information than telling stories. These articles and scripts provide a variety of ways to implement a wide range of navigation techniques, form simple to very complex.... keep reading

PDF Stamp Annotations
Workflow, Automation, Stamps

The Stamp Annotation on a PDF is intended to be viewed just like an ink stamp, or a tape/ink marker, on a paper document. But these stamps are more than just a static ink-like rubber stamp. They can display data collected at runtime (such as dates, times, and user or form data) and so they are very flexible and useful in a wide range of document workflows. The stamp is an important part of any document process, technical, legal, or administrative. Acrobat comes with a variety of built in stamps, but more importantly it provides tools and techniques for building custom stamps.... keep reading

All About Creating and Scripting LiveCycle PDF Forms
XFA, Forms, LiveCycle

LiveCycle forms are a very dynamic and data oriented technology based on XML. This is the second forms technology added to Acrobat and it is very different from traditional AcroForms in both structure and scripting. These articles, videos, and samples introduce the basic concepts behind LiveCycle forms and cover form design for beginning to advanced users.... 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

Common Scripting Elements (Colors, Paths, and Coordinates)

There are a number of scripting elements that are unique to AcroForm scripting and used consistently throughout the Document Object Model. These include Colors, File Paths, and Coordinates. Understanding how these elements are defined and used is a necessary Acrobat scripting skill.... keep reading

Form Data Validation

Form data validation is a standard part of creating any electronic form. It comes in two different flavors. Validation at the field level where the data is checked for proper formatting, and validation at the form level where the completeness of the form is tested before data submission. A good form design uses a combination of these two methods.... keep reading

Calculation Scripts in AcroForms

Everything about calculations for regular PDF forms (AcroForms). Entering Calculations, writing calculation scripts, samples, and some alternate uses for the Calculation Event.... keep reading

More HeadlinesMore Headlines