document.getElementById('printIframe').contentWindow.document.body.innerHTML = "<html><body><img src='" + this.img_object._img[0].src + "'></img></body></html>";
document.getElementById('printIframe').contentWindow.focus();
document.getElementById('printIframe').contentWindow.print();
document.getElementById('printIframe').contentWindow.focus();
document.getElementById('printIframe').contentWindow.print();
本文介绍了一种使用JavaScript技术动态生成图片,并将其插入到页面中,然后通过iframe实现图片打印的方法。适用于需要在网页上进行复杂打印操作的场景。

被折叠的 条评论
为什么被折叠?



