convert .doc to .pdf

Started by
3 comments, last by benryves 14 years, 5 months ago
We need a .Net tool that we can use programmatically to convert a doc to a pdf. Anyone know of a good free/cheap tool to do this? Note: It's ok if the tool needs Word on the pc to utilize the program/binaries. Thanks.
Advertisement
Why do you need a .Net tool? Just create a bat file and call it from code using OpenOffice http://www.tech-faq.com/convert-word-to-pdf.shtml
"You insulted me!" I did not say that in the private message Tom Sloper!
We'd like to stay away from needing to install additional software (like OpenOffice) on all the pc's we'll be using our program on. We were hoping to just add a dll to our project in order to get the conversion done. We've found that office 2007 has a way to do it, but we don't have licenses for 07 (and probably won't upgrade just for this reason).
You can do this if the file is postscript using ghostscript which is GPL. You should be able to call Word using a system call to save as postscript and then convert to pdf with gs.
"You insulted me!" I did not say that in the private message Tom Sloper!
I use Word's COM API to print to a PostScript file then convert to a PDF with GhostScript as part of web service. The Office COM API is pretty horrible to call from C# (finally fixed in C# 4.0 with support for optional ref and support for missing arguments) but it works. However, there are some issues with this technique - for one, there's no way to hide dialogs. Most noticeable is the print dialog, but if Word crashes and then has to display the file recovery dialog the next time it starts up or the file you're opening is locked for editing for some reason your app will hang until the user clicks through Word's UI. In a carefully controlled environment you can get away with these things, but probably not if this is software the user interacts with normally.

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

This topic is closed to new replies.

Advertisement