Convert html to doc in java

Edd picture Edd · Mar 23, 2011 · Viewed 26.5k times · Source

I would like to convert either an html or xhtml document (preferably with styles) to Microsoft .doc and/or .docx format.

There seem to be plenty of examples for doing this the other way around but I haven't found any useful examples for converting to ms document formats.

Can anyone point me to an api or provide an example for doing this please

Many thanks

Answer

JasonPlutext picture JasonPlutext · Apr 2, 2012

docx4j 2.8.0 supports converting XHTML documents and fragments to docx content. Disclosure: I wrote some of the code.