Convert html to doc in java

前端 未结 5 713
生来不讨喜
生来不讨喜 2020-12-06 19:34

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 doin

相关标签:
5条回答
  • 2020-12-06 19:42

    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.

    0 讨论(0)
  • 2020-12-06 19:43

    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

    0 讨论(0)
  • 2020-12-06 19:44

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

    0 讨论(0)
  • 2020-12-06 19:47

    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).

    0 讨论(0)
  • 2020-12-06 20:06

    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

    0 讨论(0)
提交回复
热议问题