Page 1 of 1

html to wordML

PostPosted: Wed Dec 07, 2011 5:51 pm
by nmcuong2005
Please help me!
Docx4j can convert html to word ML
Ex:
xml = ConvertHtmlToXML(html);

input: String html ="<u><i><b>Have a Great Day Ahead</b></i></u>"


output: String xml ="
<w:p>
<w:r>
<w:rPr>
<w:u w:val="single"/>
<w:i/>
<w:b/>
</w:rPr>

<w:t>Have a Great Day Ahead</w:t>
</w:r>
</w:p>"

Re: html to wordML

PostPosted: Wed Dec 07, 2011 9:54 pm
by jason
There is code in SVN trunk to do this. See http://www.docx4java.org/svn/docx4j/tru ... /in/xhtml/
and http://www.docx4java.org/svn/docx4j/tru ... XHTML.docx for some relevant info.

tables aren't converted yet, though.

For this to work, you need to build https://github.com/plutext/flyingsaucer
or you could try the slightly older http://www.docx4java.org/docx4j/docx4j- ... 111113.jar

Please note this is currently unsupported bleeding edge stuff!

Re: html to wordML

PostPosted: Thu Dec 08, 2011 8:43 pm
by nmcuong2005
Thanks.
I hope docx4j 2.8 release support tags : <p>, <u>, <i>, <b>, <sub>, <sup>, <table>,<ul>,<li>