我正在创建一个打印界面,可以在其中指定打印URL。它适用于网页,但这是PDF发生的事情:
我做错了什么?这是我的代码:
function regPrint(url) {
var printPopup = window.open("", document.title, "width=640, height=360");
printPopup.document.open();
printPopup.document.write("<!DOCTYPE html><html><head><style>body {scrolling:no;}; iframe {position:absolute; z-index:1; top:0px; left:0px;};</style><script>window.onload = function () { window.print(); window.close(); }</script></head><body><iframe frameborder='0' width='100%' height='100%' src='"+url+"'></iframe></body></html>");
printPopup.document.close();
}