我是靠谱客的博主 受伤溪流,这篇文章主要介绍web生成pdf后的直接打印,隐藏iframe,现在分享给大家,希望可以做个参考。

页面  <iframe id="iPrint" style='height:0; width:0;' ></iframe>

<input type="button" value="Print" οnclick="PrintPdf()"/>

<script type="text/javascript">

function PrintPdf() {

           if (document.getElementById("iPrint").attachEvent) {

                document.getElementById("iPrint").attachEvent("onload", function () { document.getElementById("iPrint").focus(); document.getElementById("iPrint").contentWindow.print(); });


            } else {
                document.getElementById("iPrint").onload = function () {
                    document.getElementById("iPrint").focus(); document.getElementById("iPrint").contentWindow.print();
                }
            }

            document.getElementById("iPrint").src = "./invSa.aspx?action=toPdf";

}

</script>


table模板aspx生成pdf可参考

http://blog.csdn.net/luan729/article/details/51818914


vs2010 asp.net  

实例下载地址:http://218.95.37.10:8085/Html2pdf.rar

最后

以上就是受伤溪流最近收集整理的关于web生成pdf后的直接打印,隐藏iframe的全部内容,更多相关web生成pdf后内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(112)

评论列表共有 0 条评论

立即
投稿
返回
顶部