我有一个按钮可以将我的html打印成PDF格式。问题是我需要把它打印成两页。不同的浏览器把它弄乱了,不能正确打印第二页。如何使用我的代码指定页面2..
       function printPageArea(areaID){
       var printContent = document.getElementById(areaID);
       var WinPrint = window.open('', '', 'width=830,height=792');
       WinPrint.document.write(printContent.innerHTML);
       WinPrint.document.close();
       WinPrint.focus();
       WinPrint.print();
       WinPrint.close();
        }    <a href="javascript:void(0);" style="position: relative;left: 0;top: 50px;" onClick="printPageArea('printableArea')"><button class="custom" style="width:auto!important;">Download PDF</button></a>
     <div class="content-wrap-consent" id="printableArea">
     <div class="page-one">
     Page One
     </div>
    <div class="page-two">
    Page two
    </div>
    </div>
发布于 2016-10-28 15:03:56
https://stackoverflow.com/questions/40299663
复制相似问题