Printing multiple PDF files using JavaScript

javascript

Solution

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();
    }
}

Problem

I want to know how to print multiple PDF files in a single print click. I can easily print single PDF file but I dont know how to print when there are more files. Thanks in advance.

Original source

Related problems