BatchPrintPDF
Description (requires ScriptX v7.1 or later)
Downloads Adobe AcrobatTM or Microsoft OfficeTM files and prints them out in batch mode in the background. Any number of printouts can be queued.
For Microsoft OfficeTM files, BatchPrintPDF prints only on the default printer using default settings.
For Adobe AcrobatTM files, relevant current printing settings are used as described in the syntax section.
This updated functionality now requires v7.1 or later of ScriptX and an Enhanced PDF Printing license.
Please note that the spool-size of printed PDF documents when printing with an Enhanced PDF Printing license may be larger than expected with consequences for performance. Please evaluate whether performance is acceptable.
Use IsSpooling to check if there are any outstanding downloads in the queue created by BatchPrintPDF. Use WaitForSpoolingComplete to wait for all documents to be downloaded and spooled.
An extended version of this method is also available with ScriptX v7 and later; BatchPrintPDFEx provides progress callbacks as the queue is processed.
Syntax
printing.BatchPrintPDF(url)
Parameter | Description |
---|---|
url | The url of the document to be printed. |
For Adobe AcrobatTM files and where an Enhanced PDF Printing license is available, the following printing settings are used:
- printing.printer
- printing.paperSize
- printing.paperSource
- printing.portrait
- printing.copies
- printing.collate
- printing.duplex
- printing.SetPrintScale(-1) the use of SetPrintScale(-1) enables “Shrink to Fit” of the printed output. Also, pages are rotated to fit on the output medium, and center on the page is set. Any other value given to SetPrintScale is ignored.
- printing.SetPageRange(false, startPage, endPage) to set a single range of pages to print
- printing.enhancedFormatting.pageRange to set a list of pages to print (requires ScriptX 7.3 or later)
Example
Here is a basic example of BatchPrintPDF usage:
<body>
<script>
function BatchPrintPDF(url) {
// ensure shrink to fit if needed
factory.printing.SetPrintScale(-1);
factory.printing.BatchPrintPDF(url);
}
</script>
<button id="idPrint" onclick="BatchPrintPDF('report.pdf')">
BatchPrintPDF('report.pdf')
<button>
</body>