[英]Keep CKEditor formatting when exporting to MS Word
I'm trying to export a text area (for which I use ckeditor) into a Word document. 我正在尝试将文本区域(为此使用ckeditor)导出到Word文档中。 I'm using JSP, and setting HTTP headers of a target page to receive the textarea value in request scope:
我正在使用JSP,并设置目标页面的HTTP标头以在请求范围内接收textarea值:
<%@page contentType="application/vnd.ms-word"%>
response.setHeader("Content-Disposition", "attachment;filename=responseLetter.doc")
...
<%=textAreaReqScopeValue%>
However, I lose formatting and style of my source ckeditor (example below) when the Word document has been generated: 但是,生成Word文档时,我的源ckeditor的格式和样式(以下示例)丢失了:
<p>Dear Anonymous,</p><p>This is in response to your <strong><em><u>request regarding your continued ...
Is there any way to keep the formatting, either by generating the Word document or through CKEditor? 是否可以通过生成Word文档或通过CKEditor来保持格式?
Using googoose.js or html-doc.js solved my problem. 使用googoose.js或html-doc.js解决了我的问题。 An open xml library should have been used to process html tags for the ms-word output.
应该使用一个开放的xml库来处理ms-word输出的html标签。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.