Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing multiple PDF files using JavaScript

Tags:

javascript

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.

like image 506
zahir hussain Avatar asked Aug 25 '11 08:08

zahir hussain


People also ask

How do I print multiple files at once?

Files selected with Ctrl. This is the easiest way to mark a few files for printing. To use this hotkey, simply click on the first file you want to select, then press the Ctrl key. While holding this key, click on all the other files you want to print.

How do I batch print a PDF in Adobe?

Get the Files into the Portfolio It's OK if the documents are in sub-folders. The Combine Files window opens. B) Click the Add button and choose Add Folders, then browse to the folder of files you wish to print. In the Options window, check “Convert all Files to PDF when creating a portfolio”, then click OK.

How do I batch a PDF file?

Convert multiple files into a single PDF.Open your favorite web browser and navigate to Acrobat. Select Combine Files. Drag and drop your files into the conversion frame. You can also locate your files manually.


1 Answers

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();
    }
}
like image 87
Shadow Wizard Hates Omicron Avatar answered Sep 21 '22 14:09

Shadow Wizard Hates Omicron