These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Java Flattening Script Not Available

AdobeUser
Registered: Aug 22 2007
Posts: 24

Hello, I have just upgraded from Adobe Acrobat 7 to ver 8. We use digital signing and use the Java Flattening Script to "Lock" the signature to the page. I have one user, who has the Java script (flatten_pages.js)located in the normal location of C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Javascripts. Usually, when the script is located properly, the image of a down pointing arrow is displayed on the toolbar. When I look on other users PCs and select more tools, it shows this by adding another selection on the dialog box, which says "Add-on Tools Toolbar". All except this one user, have this option and are able to complete their digital signatures. When the toolbars are edited for this one user, under More Tools, there is no marker of "Add-on Tools Toolbar" and I am not certain how to get this to work properly. In an effort to cover all the bases, I also put the flatten pages script in their profile location, but did not get it to work there either. Is it possible there is some corruption in the install, or that the install is not complete, and this causes the problem? I believe the java.api is available and there is no error at startup, just this one problem. Thanks

My Product Information:
Acrobat Standard 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First, its important to use the correct terminology. The Acrobat scripting language is [b]JavaScript[/b] not Java. It's an unfortunate name, but that's what it is.

There are a few things that could cause a JavaScript toolbar button not to load.

1. JavaScript is turned off. Check the JavaScript preferences panel. Select the "Edit > Preferences > General" menu item and click on "JavaScript" in the panel on the left of the preferences dialog. The first check box should be selected.2. There was an error in the JavaScript code. You can see reported scripting errors in the JavaScript Console Window. Here's an artical on using the Console window:

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/

3. The toolbar button is created with a folder level script. Above you correctly identifed the most common location for Acrobat's script folder. But this does not have to be the location. You can make sure by running some code from the console window. You'll find more info in this article.

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/folder_level_scripts/

Also make sure that you don't have duplicate scripts in both scripting locations, and there are not duplicate JavaScript names defined in the existing scripts.

4. Flattening Pages is a simple one line piece of code. Try running it from the Console window as a sanity check.

this.flattenPages();

You might also try a different Flatten Pages tool. You can download one here

http://www.windjack.com/products/freestuff.php

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

AdobeUser
Registered: Aug 22 2007
Posts: 24
Hello I managed to get this flattening script to work after checking all of these suggestions and I did a repair of the installation in "Add/Remove Programs".

Thanks