How to use Freemarker to convert a XML Word document to a DOC?
I'm trying to use Freemarker to convert an XML Word document to a stan开发者_开发问答dard DOC. For example:
- I generate a Word document (
A.doc
) and then save it as XML Word document (A.xml
). - On Freemarker, I import
A.xml
and export it as 2003 Word (B.doc
). - In POI, I import the converted DOC (
B.doc
). (POI can't read XML docs.)
The problem is: the converted document isn't really a DOC, it's an XML doc,
so POI fails to open it.How to use Freemarker generate a real DOC, not a XML word document?
I'm using Linux.Your approach probably won't work because FreeMarker is designed for generating text output. Classic Word DOC files are not very "textual", so I think FreeMarker is not the right tool for your task.
(Side note: but RTF might work)
精彩评论