Java Acrobat Reader

broken image


Similar topics

Acrobat Reader Free Download 10

4 posts views Thread by dixie | last post: by
2 posts views Thread by jimfortune | last post: by
4 posts views Thread by Jedi10180 | last post: by
reply views Thread by sandeepk84 | last post: by
5 posts views Thread by CDMAPoster | last post: by
6 posts views Thread by Filips Benoit | last post: by
6 posts views Thread by Andrew Poulos | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw?= | last post: by
3 posts views Thread by SwissProgrammer | last post: by
reply views Thread by NeoPa | last post: by
2 posts views Thread by InnovationMUK | last post: by
reply views Thread by SwissProgrammer | last post: by
reply views Thread by mykonto | last post: by
reply views Thread by initdebug | last post: by
29 posts views Thread by isladogs | last post: by
10 posts views Thread by isladogs | last post: by
1 post views Thread by luna Baker | last post: by
By V. Subhash
Java Acrobat Reader

Most people associate JavaScript with Web browsers and HTML pages. (Not many people remember that Internet Explorer supported VBScript as an alternative for JavaScript.) JavaScript has also been used on the server-side in Classic ASP as an alternative for VBScript. JavaScript on the server-side is not a recent phenomenon with Node.js and other technologies. The well-known Adobe Flash player runs a form of JavaScript called ActionScript. At least most virus writers know that JavaScript can be run from your Windows command prompt.

Although JavaScript requires a scripting host application, it is not tied to any particular implementation. The language is developed and standardized by the ECMA independently of the scripting hosts.

The flaw affects all currently supported shipping versions of Adobe Reader and Acrobat (Adobe Reader and Acrobat 9.1, 8.1.4, and 7.1.1 and earlier versions). Java Reader free download - Foxit Reader, DJ Java Decompiler, Java Runtime Environment (JRE) (64-Bit), and many more programs.

The scripting host in a Web browser exposes the 'host objects' such as window, document (DOM) and location Desktop video editor free. objects to the JavaScript engine. Similarly, in Adobe Reader, Adobe Acrobat and other applications, the viewer exposes several host objects to the JavaScript engine. These host objects are described in two documents:

HTML+JavaScript or DHTML was once sold to the general public as 'HTML with steroids'. JavaScript can indeed super-charge your PDF documents. In this article, we will see a bit of what you can do with it. I have used PDFOne .NET to add JavaScript to PDF documents. You can do the same with any PDF library such as PDFOne (for Java) and PDFtoolkit VCL.

A 'Hello, World!' Example

This code snippet uses the app object's alert() method. This alert has been added to the document's 'Open' viewer application event. There are other situations where you can add such JavaScript scripts - 'close', 'save', or 'print'.

Acrobat Reader 9 Free Download

Let us look up the app object in the API Reference.

Now, using the API reference, the above alert can be made less foreboding.

Add JavaScript to PDF objects

JavaScript scripts can be added to PDF objects such as annotations, form fields and even bookmarks. In the following example, a JavaScript script has been added to a link annotation.

This JavaScript script uses the this object where it refers to the Document object. Document has a numPages property for providing the page count.

BTW, this refers to different things in different places. Please read the documentation to avoid making mistakes. Another thing to note is that in Adobe Reader, the document is considered read-only with limited scope for modification. Any JavaScript code that tries to make permanent changes to a document will fail or require the end-user to save change to a new file.

I know what you are thinking. What if you commit errors in your JavaScript scripts? Well, you can check the console.

Acrobat reader 9 free download

Most people associate JavaScript with Web browsers and HTML pages. (Not many people remember that Internet Explorer supported VBScript as an alternative for JavaScript.) JavaScript has also been used on the server-side in Classic ASP as an alternative for VBScript. JavaScript on the server-side is not a recent phenomenon with Node.js and other technologies. The well-known Adobe Flash player runs a form of JavaScript called ActionScript. At least most virus writers know that JavaScript can be run from your Windows command prompt.

Although JavaScript requires a scripting host application, it is not tied to any particular implementation. The language is developed and standardized by the ECMA independently of the scripting hosts.

The flaw affects all currently supported shipping versions of Adobe Reader and Acrobat (Adobe Reader and Acrobat 9.1, 8.1.4, and 7.1.1 and earlier versions). Java Reader free download - Foxit Reader, DJ Java Decompiler, Java Runtime Environment (JRE) (64-Bit), and many more programs.

The scripting host in a Web browser exposes the 'host objects' such as window, document (DOM) and location Desktop video editor free. objects to the JavaScript engine. Similarly, in Adobe Reader, Adobe Acrobat and other applications, the viewer exposes several host objects to the JavaScript engine. These host objects are described in two documents:

HTML+JavaScript or DHTML was once sold to the general public as 'HTML with steroids'. JavaScript can indeed super-charge your PDF documents. In this article, we will see a bit of what you can do with it. I have used PDFOne .NET to add JavaScript to PDF documents. You can do the same with any PDF library such as PDFOne (for Java) and PDFtoolkit VCL.

A 'Hello, World!' Example

This code snippet uses the app object's alert() method. This alert has been added to the document's 'Open' viewer application event. There are other situations where you can add such JavaScript scripts - 'close', 'save', or 'print'.

Acrobat Reader 9 Free Download

Let us look up the app object in the API Reference.

Now, using the API reference, the above alert can be made less foreboding.

Add JavaScript to PDF objects

JavaScript scripts can be added to PDF objects such as annotations, form fields and even bookmarks. In the following example, a JavaScript script has been added to a link annotation.

This JavaScript script uses the this object where it refers to the Document object. Document has a numPages property for providing the page count.

BTW, this refers to different things in different places. Please read the documentation to avoid making mistakes. Another thing to note is that in Adobe Reader, the document is considered read-only with limited scope for modification. Any JavaScript code that tries to make permanent changes to a document will fail or require the end-user to save change to a new file.

I know what you are thinking. What if you commit errors in your JavaScript scripts? Well, you can check the console.

JavaScript Error Console

Adobe Reader and Adobe Acrobat have an error console. You can enable it from Preferences from the menu or launch it using its namesake console object.

How to get something?

Acrobat Reader Free Download

Web programmers are familiar with the infamous document.getElementById() method. Does Acrobat JavaScript have something similar? There are several. The following example uses the getField() method to grab a push button form field and add some behaviour to it at startup.

PDF Form Validation With JavaScript

After you 'get' a form field, you can evaluate its value using the valueAsString property. If you find the form fields to be valid, you can submit the form using Document.submitForm() method.

Caveat emptor

Running JavaScript in PDF documents is great, no doubt, but you should not rely on it without a fallback mechanism. For example, if you are using JavaScript to do form validation, then you still need to do server-side validation. Not all PDF viewer applications have a JavaScript engine. The PDF/A standard expressly forbids JavaScript. Users may also disable JavaScript in their viewer application. Digital signatures may also add their own complications to the mess. Worst of all, it is not all that easy to add JavaScript or debug it. Gnostice wishes you good luck in your personal forays into AcroJS.

Further Reading





broken image