导出到 MS Word 时保留 CKEditor 格式

Keep CKEditor formatting when exporting to MS Word

我正在尝试将文本区域(我使用 ckeditor)导出到 Word 文档中。我正在使用 JSP,并设置目标页面的 HTTP headers 以接收请求范围内的文本区域值:

<%@page contentType="application/vnd.ms-word"%>
response.setHeader("Content-Disposition", "attachment;filename=responseLetter.doc")
...
<%=textAreaReqScopeValue%>

但是,在生成 Word 文档后,我丢失了源 ckeditor(下面的示例)的格式和样式:

<p>Dear Anonymous,</p><p>This is in response to your <strong><em><u>request regarding your continued ...

有什么方法可以保留格式,通过生成 Word 文档或通过 CKEditor?

使用googoose.js或html-doc.js解决了我的问题。应该使用开放的 xml 库来处理 ms-word 输出的 html 标签。