By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,188 Members | 502 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,188 IT Pros & Developers. It's quick & easy.

Print PDF file using javascript without opening it

P: 1
I got this link from your site..

I found following code to print pdf file from the link

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script>
  4. function doit() {
  5. var x = document.getElementById("doodad");
  6. //.document.plugins.whatever
  8. x.setActive();
  9. x.focus();
  10. x.print();
  11. }
  12. </script>
  13. </head>
  14. <body>
  15. <embed id="doodad" src ="D:\Documents and
  16. Settings\ron\Desktop\eth_cli.pdf" width="550" height="550"
  17. name="whatever">
  18. <button onclick="doit()">howdy</button>
  19. </body>
  20. </html>
I am using this code in application
This code is working fine in IE but in Mozilla this is not working.

Please resolve it
Jun 19 '09 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
If you embed it, you are technically opening (downloading) it.

Perhaps you could try using PDF JavaScript to print it on load.
Jun 19 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.