2

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?

3 Answers 3

4

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).

Sign up to request clarification or add additional context in comments.

5 Comments

In 2021, this NOA doesn't seem to exist anymore.
@lvr123: Thanks for the heads-up. NOA still exists, but the URL changed. Edited to update.
Looking at it eagerly.
Are there builds available on some Maven repo ?
Sorry, no idea.
3

try the ODF Toolkit project . it has an API that allows you to manipulate openoffice documents without having openoffice.org installed in your client machine. here is a good article that get you started with ODF toolkit : Integrate OpenOffice with Java without Installing OpenOffice

Comments

0

I once used OpenOffice for MS Word to PDF conversion. Although it was the only free solution, I wasn't quite satisfied with the resulting PDF file, specially when your document has complex bidi scripts.

For conversion, as far as I can remember, there was two possible ways. One to use OS pipes and the other was socket or something. I don't have my code right now, but the only thing you need is to search in that URL. You should first launch an OpenOffice executable file (I just followed a simple turorial in OpenOffice wiki) with some parameters, and then run your Java application, using provided Java libraries.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.