JS 实现PDF文件打印

    function PdfPrint() {
        bdhtml = window.document.body.innerHTML;
        sprnstr = "<!--startprint-->";
        eprnstr = "<!--endprint-->";
        prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
        prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
        window.document.body.innerhtml = prnhtml;
        window.print();
    }

posted @ 2016-05-03 16:05  李寒星  阅读(3340)  评论(0编辑  收藏  举报