Page 1 of 1

Open .rtf with docx4j

PostPosted: Fri Dec 05, 2014 8:23 pm
by Lars10503
Is there any way to open a rtf-File?

I tried:

WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new FileInputStream(new File(dataDir + "file.rtf")));

Or is there another lib wich can do this?

Re: Open .rtf with docx4j

PostPosted: Fri Dec 05, 2014 9:12 pm
by jason
docx4j is for docx files.

You could first convert rtf to docx using LibreOffice. Or Microsoft Word, of course.

Re: Open .rtf with docx4j

PostPosted: Sat Dec 06, 2014 11:05 pm
by Lars10503
Thanks for your answer, but my Problem is that I get a huge number of rtf files from another system and have to automatically convert it into docx files with Java.

Do you know any way do do this?

Re: Open .rtf with docx4j

PostPosted: Sun Dec 07, 2014 8:51 am
by jason
Use LIbreOffice, driven by JODConverter.


At mirkonasato says:

I started this project back in 2003, but I am no longer maintaining it. I moved the code here at GitHub in the hope that a well-maintained fork will emerge.

see further!topic ... pB54AmCbfQ

and he doesn't seem to be accepting pull requests

So far, a well-maintained fork doesn't seem to have emerged, perhaps because jodconverter is pretty good as it is?

But maybe is a contender?