We are looking for a way of merging all the documents in a Document Set into a single .pdf file.
Within our SharePoint 2010 website, we have created a custom Document Set content type with certain metadata associated with it. The Document Set can contain any type of files (Word Documents, Excel Documents, PDFs, images, AutoCAD files and other formats). All the files within the Document Set will have a group type associated with them (stored as an additional property/column). For this purpose, our Document Set will only allow three group types. To make it easier to follow, let's say that any file can be of Group Type A, B or C. There will be only one file of Group Type A, one file of Group Type B and all the other files will be of Group Type C.
What we need to do is create a compiled report from all the files within the Document Set. All the documents that are printable to PDF should be merged into a single PDF with the following structure:
- The Group Type A file first (it will be either a PDF or Word Document)
- The Group Type B file next (it will be a PDF, Word Document or image)
- The Group Type C printable files in any order
Using iTextSharp, we have created a small class that is able to access the files and merge all the PDFs from a particular Document Set into a single PDF. The problem is that we need the other documents that can be converted to PDF to be included in the report. iTextSharp can only read data from PDFs and write it to a new PDF. Is there a way of converting all those documents to PDF on the run and then use the temporary PDFs to merge them into the final PDF? Or (even better) print those documents straight into a single PDF file?
We have found a software that can do the job, but the problem is that it is very expensive and it does a lot more than we actually require.
Any idea or suggestion will be highly appreciated. If you need any further information, please feel free to ask.
Thank you very much for your time!