views:

1074

answers:

4

I have a situation where in a web application a user may need a variable list of PDFs to be printed. That is, given a large list of PDFs, the user may choose an arbitrary subset of that list to print. These PDFs are stored on the file system. I need a method to allow users to print these batches of PDFs relatively easily (thus, asking the user to click each PDF and print is not an option) and without too much of a hit on performance.

A couple of options I've thought about:

1) I have a colleague who uses a PDF library that I could use to take the PDFs and combine them on the fly and then send that PDF to the user for printing. I don't know if this method will mess up any sort of page numbering. This may be an "ok" method but I worry about the performance hit of this.

2) I've thought about creating an ActiveX that I would pass the PDFs off to and let it invoke the printing features. My concern is that this is needlessly complex and may present some odd user interactions.

So, I'm looking for the best option to use in this scenario, which is probably not one of the ones I've gone through.

+3  A: 

The best solution I have for you is number 1. There are plenty of libraries that will merge documents. From the one I've used the numbering should not be an issue since all the pages are all ready rendered.

If you go with ActiveX you are going to limit yourself to IE which might be acceptable. The only other idea would be to use a smart client so you can have more control...then you could serve up the PDF's via a web service.

JoshBerke
+1  A: 

Print from the server, perhaps?

http://stackoverflow.com/questions/345224/printing-server-side-from-net-without-winforms

Quog
+1  A: 

I agree with #1. You could do some tests to see what the performance hit would be like.

Kevin Tighe
Yeah, I'll go with that and benchmark.
BobbyShaftoe
+3  A: 

I think concatenating the documents is the way to go. For tools I recommend iText#. Its free :) http://sourceforge.net/projects/itextsharp/

Andy Webb
Thanks, I have access to a commerical PDF library but if that is more complicated than I like, I'll look at iTextSharp.
BobbyShaftoe
Is there anyway to use the program in Mac/Ubuntu?
Masi