【发布时间】:2017-02-15 05:43:40
【问题描述】:
我想在加载所有图像(并且文档准备好)后以打印模式打开一个新窗口。 这是我的代码:
var win = window.open();
//css ltr
win.document.write('<style>body { direction: rtl; unicode-bidi: bidi-override; }</style>');
//insert img
win.document.write('<img src="assets/imgs/logo.png">' + '<br>');
//insert txt
win.document.write(pdf);
win.document.write('<br>');
win.document.write('<img src="assets/imgs/buttomLogo.png">' + '<br>');
win.print();
win.close();
我曾尝试使用onLoad(),但它打印的文档没有图片:
win.onload = function () {
win.print();
win.close();
}
如何以打印模式打开包含所有图像的文档? 小提琴 - printer.
谢谢。
【问题讨论】:
-
如果有几张图片?
标签: javascript