Solved

Javascript Print Button in Acrobat

Posted on 2004-09-16
2
814 Views
Last Modified: 2006-11-17
I have set up a button to print a document, but it does not work.

The document with the button is at goodmorals.org/acrobat.

What is missing from the this.print javascript that makes the button fail?

Also, what is the simplest way to create a beveled button and one that bevels in when clicked on.

Thank you for your assistance.
0
Comment
Question by:goodmorals
  • 2
2 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12079837
The problem is that Acrobat is counting pages differently than you are :-) The first page in a PDF file (as far as Acrobat is concerned) is page 0. You are printing page 1 to 1, which translated into more human understandable language is actually page 2 to 2. Your document only has one page, so Acrobat reports an error (which you can see when you open up the JavaScript console). Change your print command to
this.print(true, 0, 0, true);
and it should bring up the print dialog.

You can change the button face by assigning a button image (you can do this on the button properties dialog by selecting the Options tab, and then changing the Layout option. You then need to assign a PDF page as button image). You can however not modify the look of the button when it's being clicked on.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 250 total points
ID: 12079861
Actually, I was wrong: I just checked the "Options" tab again, and you can have different images for the different states of a button: not selected, mouse over and selected. Just set the "Behavior" setting to "Push", and then assign three (or two, if you don't care about the mouse over) PDF pages to the different icons.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now