【发布时间】:2017-12-29 05:00:04
【问题描述】:
您好,我正在使用此代码打印窗口内容
"<html><head><script>function step1(){\n" +
"setTimeout('step2()', 1000);}\n" +
"function step2(){window.print();}\n" +
"</scri" + "pt></head><body onload='step1()'>\n" +
"<object id='PrintId' data='"+source+"' type='application/pdf' style='width:100% !important;height:100% !important'><embed id='PrintId' src='" + source +
"' type='application/pdf' style='width:100% !important;height:100% !important'/></object></body></html>";
正如我使用“图像标签”而不是“对象”和“嵌入”标签来打印图像的相同代码,它工作正常,但对于 PDF 或 Docx、txt 文件,它在我错的任何浏览器上都不起作用,请帮助我
谢谢
【问题讨论】:
标签: javascript jquery html model-view-controller printing