JavaScript - Introduction to Development with Examples

June 23, 2000

Advertisement

Advertisement

Adobe Acrobat allows you to utilise JavaScript within Acrobat Forms by defining an object model on top of JavaScript 1.2. These objects are only defined within the Adobe Acrobat realm and are specific to Acrobat Forms. They mirror the Acrobat Forms components and give the forms developer a way to access these components programmatically in order to query and change their properties.

What is JavaScript?

JavaScript is the scripting language developed by Netscape Communications and is commonly used to create interactive Web pages. JavaScript v1.2 comes with six predefined classes: Boolean, Number, Date, Math, String, and Array. Additional classes and objects have been defined to allow access to portions of the PDF file.

Tutorial 1: Copying Fields

It often takes some intense manipulation of fields to get things just right on a form. Proper coloring, sizing, actions and JavaScripts all make up a field. It is often the case that you need to make a copy of a field within a form but did you know that you can save your form fields to a separate file and copy and paste them for later use? This tip shows you the three different forms of copying that are available in Acrobat Forms Author version 3.5 and higher. Control-Drag Copy, Clipboard Copy, Duplicate Fields

Tutorial 2: Making a Table

Many forms use tables or arrays of similar fields for adding numbers or detailing items. Purchase orders, expense reports, and bills of lading are just some examples of how groups of fields are used in this manner. Unfortunately, Acrobat Forms doesn?t include the ability to create arrays in an automatic manner. But with a little knowledge about accurate placement of fields, multiple selection and alignment, and the new grid feature, this can be a much less painful authoring procedure.

Tutorial 3: Formatting and Calculations

We now have an invoice that can be filled in, but it is rather dumb. A user must perform his own calculations to figure out totals and shipping. Fortunately, the latest version of the forms plug-in includes a JavaScript interpreter that will allow you to rectify this dismal situation. In particular, the format and calculations tabs are at your disposal.

Adobe Store order form

Add pizzazz to a company picnic... Reward an employee... Present an upbeat corporate image at a trade show.. This one is the grand-daddy of all examples here. You'll see samples of all sorts of JavaScript in this one.

Planet PDF talks with another Master of the PDF Universe, Eugene Y. Xiong, Founder and Chairman of the Board at Foxit Software Inc. in Fremont California. Xiong is a quiet yet astounding achiever, you (usually) won't find him talking at conferences, exhibits, or publishings, but what you will find is the result of his leadership in places you would never expect.

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.