html: print() embed file

后端 未结 1 1038
时光说笑
时光说笑 2021-01-06 12:31

I am showing a pdf inside a html using:

 
<
相关标签:
1条回答
  • 2021-01-06 12:40
    <script type="text/javascript">
    function printPDF(pdfUrl) 
    {
        var w = window.open(pdfUrl);
        w.print();
    }
    </script>
    

    You can call this function printPDF("http://mywebsite.com/myfile.pdf")

    0 讨论(0)
提交回复
热议问题