<p>We are developing a little application that given a directory with PDF files creates a unique PDF file containing all the PDF files in the directory. This is a simple task using iTextSharp. The problem appears if in the directory exist some files like Word documents, or Excel documents.</p>

<p>My question is, is there a way to convert word, excel documents into PDF programmatically? And even better, is this possible without having the office suite installed on the computer running the application?</p>

[{'answer_id': 39045, 'author': 'Galwegian', 'author_id': 3201, 'author_profile': 'https://Stackoverflow.com/users/3201', 'pm_score': 0, 'selected': False, 'text': '<p>You can also use a component like activePDF\'s <a href="http://www.activepdf.com/products/serverproducts/docconverter2009/" rel="nofollow noreferrer">DocConverter</a> to convert a <strong>lot</strong> formats to PDF. </p>\n'}, {'answer_id': 39139, 'author': 'Fionnuala', 'author_id': 2548, 'author_profile': 'https://Stackoverflow.com/users/2548', 'pm_score': 3, 'selected': True, 'text': '<p>Office 2007 allows for this. I have found <a href="http://sourceforge.net/projects/pdfcreator/" rel="nofollow noreferrer">PDFCreator</a> to be good, the VBA is included in sample files, and have heard that <a href="http://www.cutepdf.com/" rel="nofollow noreferrer">CutePDF</a> is also good. PDFCreator and CutePDF are free.</p>\n\n<p>To work without Office, you would need viewers, as far as I know:\n<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&amp;displaylang=EN" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&amp;displaylang=EN</a></p>\n\n<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=95E24C87-8732-48D5-8689-AB826E7B8FDF&amp;displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?familyid=95E24C87-8732-48D5-8689-AB826E7B8FDF&amp;displaylang=en</a></p>\n'}, {'answer_id': 39142, 'author': 'prakash', 'author_id': 123, 'author_profile': 'https://Stackoverflow.com/users/123', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.xtras.net/products/tallpdfdotnet/" rel="nofollow noreferrer">TallPDF.NET</a> (comes with a hefty price tag) allows you to serve dynamic PDF from any .NET application including ASP.NET pages and web services.</p>\n\n<p><a href="http://pdfedit.petricek.net/index_e.html" rel="nofollow noreferrer">PDFEdit</a> (free and open source) is an editor for manipulating PDF documents. It has a GUI version and a command-line interface. Scripting is used to a great extent in the editor and almost anything can be scripted. It is possible to create your own scripts or plugins.</p>\n'}, {'answer_id': 39190, 'author': 'Mark Harris', 'author_id': 4026, 'author_profile': 'https://Stackoverflow.com/users/4026', 'pm_score': 0, 'selected': False, 'text': '<p>The most common way to convert files to a pdf is to print them to a pdf printer driver. There are a number of such drivers, one that i know of that will do the job is <a href="http://www.blackice.com/Printer%20Drivers/" rel="nofollow noreferrer">Black Ice</a>. </p>\n\n<p>Another is to use Adobe Acrobat\'s SDK. from memory its very expensive.</p>\n\n<p>Its been a while since i have actually done any work with converting pdf\'s and the landscape may have changed. </p>\n'}, {'answer_id': 885812, 'author': 'Mark Glorie', 'author_id': 952, 'author_profile': 'https://Stackoverflow.com/users/952', 'pm_score': 2, 'selected': False, 'text': '<p>I needed to do this myself, but managed to get it done with .Net and without 3rd party tools:  </p>\n\n<p>MSDN: <a href="http://msdn.microsoft.com/en-us/library/bb412305.aspx" rel="nofollow noreferrer">Saving Word 2007 Documents to PDF and XPS Formats</a></p>\n\n<p>Pretty simple, about 50 lines of code. However I think you will need Word 2007 installed on the machine as well as the ability to <a href="http://www.microsoft.com/downloads/details.aspx?familyid=F1FC413C-6D89-4F15-991B-63B07BA5F2E5&amp;displaylang=en" rel="nofollow noreferrer">Save As PDF</a></p>\n'}, {'answer_id': 2767831, 'author': 'ron', 'author_id': 239226, 'author_profile': 'https://Stackoverflow.com/users/239226', 'pm_score': 0, 'selected': False, 'text': '<p>Use PDF maker that comes with adobe 7- 9 </p>\n\n<p>I just used this code <a href="http://mysharepointwork.blogspot.com/2010/04/convert-word-document-to-pdf-with.html" rel="nofollow noreferrer">Covert Doc to PDF </a></p>\n'}, {'answer_id': 4589910, 'author': 'L.R', 'author_id': 561976, 'author_profile': 'https://Stackoverflow.com/users/561976', 'pm_score': 2, 'selected': False, 'text': "<p>To convert Word documents to PDF, take a look at jWordConvert, a java library that can do exactly that. This will not work with the Excel files though, only with the Word files. The language is not Sharp, it's Java but you could switch to use IText (which is java) instead of ITextSharp. </p>\n"}, {'answer_id': 6901201, 'author': 'Mark Kadlec', 'author_id': 16642, 'author_profile': 'https://Stackoverflow.com/users/16642', 'pm_score': 0, 'selected': False, 'text': "<p>I'm surprised Aspose wasn't mentioned here, it's easy, simple, and reliable.  Downside is that it is not free.</p>\n\n<p>I've used iTextSharp in the past, it's really good, easy to install (one DLL I believe), the merge takes a bit of tindering so it's not as easy to use as Aspose, but hey, it's free so that is the best part.</p>\n"}]
['https://Stackoverflow.com/questions/39037', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3611/']