Reputation: 7489
(Short version at the end)
The software I'm currently developing is required to track an arbitrary number of MS Office files, and now needs to provide the functionality to print all of those files together, along with some application data (likely to be sent to the printer as a file of type .xps, .html, or .txt). Printing each file one by one is fairly trivial, but results in separate print jobs for each of them. This is very bad in the case of printers set up in an office to print a sheet at the beginning of each print job with the username and time of the print job, and it could allow other users sharing the printer to print between the jobs. Additionally, would there be the possibility that the jobs are not processed in the proper order?1
Is there any way to combine an arbitrary collection of Office documents as a single print job?
EDIT: An alternative solution that would be acceptable is a way to combine all of the documents to a single pdf/xps (or similar) document? This would both accomplish the primary goal, and enable quicker printing of future copies, as we could print that one large document instead of each individual document (until, of course, a new document is added).
1(Edited in after original post)
Given:
Acheive:
Question:
Can it be done? If so, how?
Upvotes: 4
Views: 2941
Reputation: 70369
Yes - if you convert all content into PDFs and join those PDFs into one...
There are some libraries out there to achieve this - but if you want to cover all office formats you might need to consider Aspose.Total .NET (not affiliated, just a happy customer)...
EDIT - as per comments:
Another option (esp. since the software is essentially a "desktop app" and http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2 does not apply mostly) is to use Office Interop to create PDF files. Text can be converted to PDF rather easily (for example by using Office Interop/Word and creating an intermediary Word document with that text).
Altogether this allows for most of the functionality asked... to make sure that no other print jobs com inbetween one could merge the PDF files into one PDF and print that... for merging PDFs there are several libraries (free like Ghostscript, commercial like Gnostice PDFOne) out there - some even allow the creation of PDFs from text/images avoiding the intermediary Word document mentioned above).
Upvotes: 1