Java – OpenOffice in Java

javaopenoffice.org

I need a Java interface to the OpenOffice document conversion which would equal to a manual (Open… and then Save As…) as well as access to the PDF generation.

The following are some example of what I want to achieve.

1) Open one type of document (fx. OpenOffice Writer document or Microsoft Office document) onto memory and save it in another supported format.

2) Open one type of document into memory and export it as PDF.

I have gone through http://api.openoffice.org but didn't get any material which can help me to get started.
I also tried JODConverter but it requires me to run OpenOffice as a service.
I wold prefer to include all the core functionality of OpenOffice in one JAR file so that that the user can use my application without installing or running openoffice on their PC.

What would be a URL/code snippet from where I can get tutorials to get started?

Also do I have to add some JAR files?
Will the application work even if I don't have OpenOffice installed on my PC?

Best Answer

You might want to have a look at noa-libre (Nice Office Access, formerly available at ion.ag). It's a Java API that wraps OO.o's native Java API to be easier to use. It allows you to quickly "remote control" OO.o.

Also tell me if i have to add some jars?

Yes, that is documented.

Will the application work even if i dont have open office not installed on my pc?

No, the application requires a running (!) instance of OO.o, as it essentially remote-controls OO.o. The instance can in theory run on another computer (controlled via network).