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

print button not working in firefox

jnixon78
Registered: Aug 10 2007
Posts: 8

Hi all,
 
I'm having a problem getting a Print button I made to work in Firefox. I actually copied this code from somewhere else on the net. Not sure why it works in IE, but not in Firefox. Can you help?
 
First, here's the print function (in javascript):
  
--------------------------------------------------
function printpdf() {
var x = document.getElementById("signingdoc");
//.document.plugins.pdfdoc
x.click();
x.setActive();
x.focus();
x.print();
}
--------------------------------------------------
  
Then, down in the body of the page, I embedded the PDF file (it's saved as a full-screen PDF), and then create a Print button and a Close button.
  
--------------------------------------------------
    
Print This Document
 
--------------------------------------------------
  
The Close button works fine in both IE and Firefox. The Print button, however, works in IE fine, but does nothing in Firefox. Please help a newbie! Thanks!

My Product Information:
Reader 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I'm afraid you're asking a question about HTML JavaScript and this is an Acrobat JavaScript resource.

Reading your previous questions I think you may be mixing the two. There are vast differences, for example,
, in the Acrobat Viewer you cannot disable Right Click, or stop the user from saving the file. The user can also override any controls you hide. However, as you've seen, you can play some tricks that will fool most users, like making it a full screen document.

These other things you're talking about like the print script above, and disabling the right click have to do with the browser, not Acrobat. You cannot place HTML JavaScript code in a PDF.


But, you could put a "Print" button on the PDF that should print regardless of which browser the PDF is displayed in. This button would of course use "Acrobat JavaScript"

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

jnixon78
Registered: Aug 10 2007
Posts: 8
"But, you could put a "Print" button on the PDF that should print regardless of which browser the PDF is displayed in. This button would of course use "Acrobat JavaScript""

Okay. How would I go about adding a print button to the PDF?