tags:

views:

52

answers:

2

I have a word file () which has many text fields and a startup macro, which, when word file is opened sets, values to fields from file properties ?!

So basically, I need API that can convert MS word (MS Office XP) to PDF. It would be great if API had a startMacro function(), but I know that is not gonna happen.

I have tried Apache POI, but there is so little support to old word format. Also i read about OO API, but I'm not able to have an OO instance running on the server.

I would gladly take any advice.

Thanks

A: 

I worked on a similar problem a year ago. I finally settled with using OpenOffice.org I'm not positive OpenOffice.org will meet your exact needs here, but I would suggest looking at it.

Andy Pryor
A: 

Can you run OpenOffice on another host (that your server can reach)? If so, you can use the OpenOffice api to open a socket to that other host to do the conversion. Docmosis is a Java library that provides an API for populating DOC and ODT files and having the formats converted. It still relies on OpenOffice being installed somewhere that your server can reach, but you don't have to configure much else.

If your documents were a newer format (Doc-xml) then you could process them directly from Java with XML, but it would be a pretty big learning curve.

jowierun