We help IT Professionals succeed at work.

Printing multiple, embedded PDF documents from html page

Hello,

Wondering how to go about printing multiple embedded pdf invoices from an html page. The invoices are embedded dynamically and could be as few as 1 or as many as ~50.  I considered using cfprint but there is a need to print from multiple locations and from what I can see cfprint only works with printers to which the application server is connected.

I also considered combining the pdf's into one pdf then having the user print that separately, but I'd rather a solution where the user prints the content of the page (html) and all of the pdf's.

 I am running ColdFusion 8 on IIS.

Thanks!
Comment
Watch Question

Most Valuable Expert 2015
Commented:
> I can see cfprint only works with printers to which the application server is connected.

Right, it's designed for server side printing only.

> I'd rather a solution where the user prints the content of the page (html) and all of the pdf's.

If you need client side printing, merging is your best bet IMO.  Due to browser security restrictions, there aren't many options for client side printing from a web app. The 2 main options are: javascript OR using signed controls.  

Javascript is simple, but you can't use it to batch print. It only allows you to display print dialogue boxes for a individual file, which would get ugly with ~50 files.  

If you're on an intranet, you could use a signed control (activeX, etc...).  Those can operate with elevated permissions avoiding such restrictions.  But users often disable them. So they're less useful on public sites where there's no control over the user environment.
you can use a command line printer   (something like http://www.verypdf.com/pdfprint/pdf-print-cmd.html - not used it myself. THere are others out there)

and either

use cfloop with cfexecute to batch print


 or set up a directory watcher eventgateway and move files that need to be printed into a special watched directory.

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-77f7.html and run the cmd line against those files.