我有一些html内容和图像,并在按钮单击时打印页面。当我第一次打印时,打印预览页面是空的,第二次是正常的。请帮助为什么它不是第一次打印页面打印在第一时间在Chrome浏览器中不工作
图像源是base-64格式。所以,由于内容较大,我无法添加代码段,请检查演示链接。
<input type="button" id="printImage" onclick=printImage() value="print" />
function printImage() {
var htmlContent = "The html code in stack-overflow exceeded. So please check with demo link for html content";
var win = window.open();
win.document.write(htmlContent);
win.document.close();
win.focus();
win.print();
win.close();
}
任何人都帮我在这..