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.
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
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.
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.
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.
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".
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.
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.
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.
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...