views:

1163

answers:

7

I'm looking for a good way to convert Office (mostly Microsoft) documents to PDF in Java. I've been looking at using the OpenOffice SDK but from the samples I've looked at it looks like this requires having OpenOffice running in server mode to do the work.

Does anyone know of a good way to do this? Good meaning the less external requirements, the better. A 100% Java API would be best, but I don't expect that actually exists.

+1  A: 
  • For accessing Office documents there exists POI
  • For creating PDF documents there exists iText

Both are free imho.

dhiller
+1  A: 

You could try using Cute PDF writer which is basically a free PDF printer driver, and will work with any printing APIs.

Shane MacLaughlin
+3  A: 

FYI looks like http://www.artofsolving.com/opensource/jodconverter nicely encapsulates all the OpenOffice server communication. This is the solution I'm pursuing at the moment.

Sindri Traustason
let us know how it goes! i am just about to start a similar project myself (ppt->image)
Stu Thompson
you rock, I've just gone over the link and it is going to do what i want and do it easier. my actual project was ppt-swf, but i assumed I had to use an intermediate format and a separate tool.
Stu Thompson
+1  A: 

The problem with Jodconvertor is that the project ended in Sep 2006. So I am not even sure it will work and run on OpenOffice 3.x. If anyone can confirm this, that would be great.

Shervin
I'm using it with OpenOffice 3.x and it seems to work fine.
Sindri Traustason
+1  A: 

An alternative to POI is Scriptom which is based on Groovy and the Jacob Library. With it, you can access ActiveX or COM Windows components. I use it whenever I have to deal with Excel files.

If you don't like Groovy, then you can build a very thin layer around the Scriptom API and use it from Java.

raoulsson
A: 

Have a look at the Muhimbi PDF Converter Web Services. It runs on Windows as a service, but can be accessed from any non-Windows web services capable environment including Java and .NET

Disclaimer, I worked on this product. Having said that, it works great.

Muhimbi
A: 

Docmosis uses OpenOffice under the hood to assist in document production like JOD Reports and JODConverter. Docmosis allows you populate and manipulate the document via the Java API. It also provides built-in scalability, redundancy and load balancing and has a very low runtime overhead.

jowierun