PDF In-Depth

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.

PDF Calculator

Improve your marks by downloading this all-purpose PDF calculator.

Photo Album

This photo album can be used to store all your family treasures.

Check

We have Two Hundred and Eleven Million Nineteen Dollars and Twenty-Three Cents that says you'll download this one, and change your name to "Lucky Guy".

Tic Tac Toe

This old favorite is certainly worth a shot. Remember three in a row to win. Bring a friend

Credit Card tester

Need to validate a credit card? This sample does all sorts.

Date manipulation

This example shows how to manipulate dates using JavaScript. Because the values for Acrobat fields are strings, it is necessary to convert the string to a date using the date constructor.

Importing icons

This example allows a user to browse for an appearance and embed it into the form.

Business Card builder

Not only will this sample build you your business cards complete with photo, it also takes care of the envelopes and letterhead as well.

Lease Vehicle Receipt

See the contraversial scrape on the left bumper of this returned vehicle.

Related Products at PDF Store

Nitro PDF Professional OCR

Nitro PDF Professional OCR gives you all the features of Nitro Pro, plus the added power of Optical ... View full product details
Download free demo

Nitro PDF Professional

Nitro PDF Professional, your PDF creation and editing product. Priced at $99.99, Nitro PDF Pro is th... View full product details
Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF view... View full product details
Download free demo

PDF In-Depth Free Product Trials Ubiquitous PDF

Nitro PDF Professional

the perfect PDF product for business and enterprise, combining an extremely competitive price with a...

Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF viewing...

Download free demo

Ubiquitous PDF: Planning for unexpected cash

It's the end of the financial year and some lucky souls are expecting a tax return. Whether or not the dollars are stacking up for you, it's worth keeping in mind this new PDF tool from Squawkfox.

July 29, 2010
Search Planet PDF
more searching options...







Download PDF Creator

Download The Best of Planet PDF volume 2
Planet PDF Newsletter
Most Popluar Articles
Features

Collating PDFs using JavaScript

Despite the numerous benefits, there can be potential issues with the conversion of paper documents into electronic archives. When scanning paper pages into PDF, it's possible to end up with the odd- and even-numbered pages in separate PDF files. It can be very time-consuming to collate them manually, but there is an easier way. Sean Stewart explains.

Featured Product

BCL easyPDF SDK

BCL easyPDF SDK is a set of PDF Programming Libraries designed specifically to help Software Developers / Programmers build and deploy enterprise class PDF applications for corporate wide PDF...

Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools QuickPDF: The Unrivaled PDF Developer Toolkit