Well, really the title of the question says it all. There are similar questions on SO already. But here's some differences... I absolutely cannot use Office on the server. I must be able to convert the document programmatically. I don't really care how much it costs. Obviously cheaper is better, but if you have a good suggestion that happens to be pricey, please feel free to include it.
------ Edit ------
I accepted the OpenOffice.org answer because it seemed like the most intriguing. However, I really am curious what other people think. Keep posting answers and voting and I'll accept whichever has the most votes.
You might want to try Aspose, which is also used by Google.
Using Convert API it is simple as this HTTP request:
if file is accessible from the internet. If file is not accessible from the internet, Convert API supports many ways how to pass a file for conversion.
OpenOffice can be run in a GUI-less server mode. Using it that way, you can connect to it, stream a document to it, and then convert to any type it supports and stream it back.
If you want to use OpenOffice then you may use from the command line unoconv with latest LibreOffice. This works in general but be prepared to:
I would discourage using UNO API directly. This is possible (and you may have a pool of running OpenOffice servers that will perform the conversion) but definitely not easy.
Google Docs is for me of no use as the conversion file size limit is 2 MB.
You might want to have a look at the CloudConvert API. They are using native Office and they are a way cheaper than Aspose.
If you upload a document (.doc, .docx, .odf) to google documents you can download as a PDF. This is an easy free solution but it might be hard to integrate.