views:

132

answers:

4

The basic API of JAVA that uses RTFEditorKit and HTMLEditorKit, is not able of recognize tags like <br/> and <table>. So I have searched on internet a better way of converting HTML to RTF and i have found two solutions that seem to work. JODConverter and HTML-to-RTFconverter. The first one needs OppenOffice installed to work and the second one uses DLL, so it can’t be used on Linux.

Does anyone know about other solution?

Thanks for any help!!!!

A: 

You can take a look at RTF Template (http://rtftemplate.sourceforge.net/) Don't know if it fits your needs, but I used several times under Linux and was OK.

Grieih
I have a HTML editor (richfaces) that generates a HTML output and I need to convert it to RTF. I think RTF Template won’t help. Thanks for helping!
Duprat
A: 

I already used the html-to-pdf and got the expected result. I have helped.

Wiliam Witter
Unfortunately the client only accepts RTF :(
Duprat
A: 

If it is valid html, you can use Apache-FOP.

There are stylesheets for transforming html to FO.

Apache FOP can write PDF and RTF as well.

http://www.torsten-horn.de/techdocs/java-xsl.htm#XSL-FO-Java

h**p://html2fo.sourceforge.net/index.html

ckuetbach
A: 

Do they want it in RTF or do they want it in Word format? There's a big difference.

Ensure your editor is generating XHTML (or convert it yourself with jtidy, htmlcleanup etc) then download the content as an XHTML but with a .doc extension and the MS Word mime type. Word 2003 or higher will open it as a word doc.

james
I have tried this option today. It worked as you said. I didn't know that Microsoft Word and OpenOffice were able of converting HTML --> RTF. Thank you so much my friend!
Duprat