javascript - Print PDF in IE using window.print -


i have pdf document i'm opening in new window using javascript , attempting print using window.print(). following code works in chrome, not ie. ideas?

var pdfwindow = window.open('/mypdf.pdf', '_blank'); pdfwindow.print(); 

that not work. if ask me, best way of implementing pdf in browser following.

create php file this: i'm calling first php file "firstfile.php"

<?php header('content-type: application/pdf'); $file='yourpdffile.pdf'; @readfile($file); ?> 

then create php file , use iframe desired pdf file. sample code below

<iframe src="http://localhost/domainfolder/firstfile.php>" height="400px" width="750px">   </iframe> 

hope helps


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -