views:

73

answers:

5

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.

A: 

You might want to try Aspose, which is also used by Google.

0xA3
I know I said price doesn't matter... but this is a bit pricey :)
Chaulky
A: 

This may help you get to the answer...

DOCX format is a zipped collection of files. Unzip one (rename to .zip) and look inside.

Chris Adragna
But this does nothing for me if it's .doc. Even it if is .docx... it would require quite a bit of work to go from XML representation of a Word document to a PDF
Chaulky
+3  A: 

OpenOffice can be run in a GUI-less server mode that. 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.

Lou Franco
I never even thought of this. I'll definitely look into this one. You mentioned it's "Server Mode". Is that to say its specifically designed for server use and doesn't suffer the same problems as Office on a server?
Chaulky
It's specifically designed to have that mode, unlike MS Office. The server is single-threaded, so it's not ideal (you have to queue requests). It's essentially just scripting the app, but with a completely suppressed GUI. In my usage, I put a web service in front of it that monitored it, queued requests, and cached documents (in case the same one came through again).
Lou Franco
+1  A: 

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.

highriseo
creative, and i'll probably play around with this just out of curiosity, but I've heard from others that it doesn't do such a great job of preserving all the format (just hear-say though)
Chaulky
+1  A: 

IMO, PDFCreator (open source) is the best bet for your pupose. Install PDFCreator, then have a look at the COM subfolder, there you can find examples of how to use its API.

Vantomex
Does this require Office on the server? I can't find information either way.
Chaulky
No, PDFCreator doesn't require Office in any form, it can even convert *any* document (created by any program) that are possible to be printed.
Vantomex
Thanks vantomex, i'll definitely check this out.
Chaulky
PDFCreator does require something capable of printing the document, whether this be Microsoft Word, or OpenOffice, or something else. It just functions like a printer.
Yuliy