Solved

Javascript Print Button in Acrobat

Posted on 2004-09-16
2
819 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

929 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