使用JavaScript打印多个PDF文件 [英] Printing multiple PDF files using JavaScript
本文介绍了使用JavaScript打印多个PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何一次单击即可打印多个PDF文件.
I want to know how to print multiple PDF files in a single print click.
我可以轻松打印单个PDF文件,但是当有更多文件时,我不知道如何打印.
I can easily print single PDF file but I dont know how to print when there are more files.
谢谢.
推荐答案
您可以在代码中多次调用 print()
,导致文件一个接一个地打印:
You can call print()
multiple times in your code, resulting in the files being printed one after the other:
function PrintAll() {
var pages = ["page1.pdf", "page2.pdf", "page3.pdf"];
for (var i = 0; i < pages.length; i++) {
var oWindow = window.open(pages[i], "print");
oWindow.print();
oWindow.close();
}
}
这篇关于使用JavaScript打印多个PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文