0

Currently i have an iframe with a pdf file embed and i wanted to print this pdf, but when i tried to print it it shows me the next message: Object doesn't support property 'print'.

This is my current iframe code:

<iframe height="329" id="pdf1" src="file.pdf" style="width: 100%;" type="application/pdf"></iframe>

And this is my javascript code:

document.getElementById("pdf1").focus();
document.getElementById("pdf1").print();

This is the way some sites recomended but still have no success. My current PDF reader is Acrobat.

Thanks in advance

martinezjc
  • 3,415
  • 3
  • 21
  • 29
  • [Related](http://stackoverflow.com/questions/18888131/print-pdf-file-in-iframe-using-javascript-getting-one-page-only) - has tips on how to invoke print, assumes you can use `` instead of ` – James Thorpe Feb 27 '15 at 21:04
  • The problem with the object is that makes a double head request and that's why i'm using the – martinezjc Feb 27 '15 at 21:05
  • [Possible duplicate](http://stackoverflow.com/questions/13656271/how-to-print-pdf-from-iframe-if-src-pdf) – James Thorpe Feb 27 '15 at 21:06
  • I don't meant to print directly, i want to show the preview print dialog – martinezjc Feb 27 '15 at 21:14

0 Answers0