开发者

cannot print popup displaying pdf file

I have a php file with the following code:

<?php

?>
<form action="" id="f1" name="f1">
    <input type="button" name="preview" value="Open PDF" onclick="showPDF()" />
</form>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
    function showPDF(){
        var newwin=window.open("pdf.pdf","Window1","menubar=no,width=430,height=360,toolbar=no");
        newwin.print();      
    }
</script>

It opens up a popup window with pdf file inside it BUT fails to open the print dialog box. But the same code wi开发者_Go百科thout the pdf filename i.e

var newwin=window.open("","Window1","menubar=no,width=430,height=360,toolbar=no");

opens up the popup window and show the print dialog box.

Can anybody provide me a solution to this


does this work?

newwin.printWithDialog();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜