Convert html to doc in java

别等时光非礼了梦想. 提交于 2019-11-28 01:14:54

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

Yet another solution would be to use jodconverter which seems to basic html to doc conversion... it doesn't claim to do it well though

vrindamarfatia

I tried docjx4j API 2.8.1 and it works like wonder. It had ConvertinXHTMLinFile and it works fine. If anyone wants the code I will post it.

Here is the link that helped me : ConvertInXHTMLFile

In order to work with Microsoft Documents you'll likely have to take a deeper look at Apache's POI Library.

Nevertheless creating .doc files with styling from (X)HTML requires some effort.

I've been spending a little time looking into docx4j. It seems to provide nice ways for creating html documents from docx but I can't see anything for the other way round.

At the moment this is still looking like the easiest method as it's just working with jaxb objects (I think).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!