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!
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