?
Solved

Javascript Print Button in Acrobat

Posted on 2004-09-16
2
Medium Priority
?
838 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
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) …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 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