?
Solved

Javascript Print Button in Acrobat

Posted on 2004-09-16
2
Medium Priority
?
844 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Acrobat’s JavaScript is a great tool to extend the application, or to automate recurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts,…
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…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…
Suggested Courses

650 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