可以将 Web WYSIWYG 编辑器生成的内容导出到 MS Word

发布于 2024-08-03 04:30:23 字数 466 浏览 2 评论 0原文

在我们的项目中,我们大量使用 HTML 和 MS Word。用户在浏览器中创建“文档”,完成后,他们使用 DocX 库 (http ://docx.codeplex.com/)。当我们只处理文本时,这很有效。

我们现在要做的是让用户格式化在浏览器中输入的文本。使用任何所见即所得浏览器编辑器都可以轻松实现这一点。问题是我们想要获取样式化的 HTML 并将其导出到 word 中。

我见过一些商业组件声称能够将 HTML 转换为 RTF,所以我想这也许可以解决这个问题,但我正在等待 DocX 支持 RTF 文本的响应。最好的解决方案是将 HTML 直接转换为 DocX 格式,但我只见过 ASPOSE 具有此功能,而且 ASPOSE 非常昂贵。

有谁知道如何解决这个问题?如何将 HTML 转换为 docx 文件?

谢谢!

In our project we work a lot with both HTML and MS Word. The users create "documents" in their browsers and when they are finished they export these documents to MS Word using the DocX library (http://docx.codeplex.com/). This works fine when we only handle text.

What we want to do now is to let the user format the text that is entered in the browser. This is easy to implement using any of the WYSIWYG browser editors. The problem is that we want to take the styled HTML and export this to word as well.

I have seen commercial components that claims to be able to convert HTML to RTF so I thought that maybe this could solve it but I am waiting for a response if DocX supports RTF text. The best solution would be to convert HTML directly to the DocX format but I have only seen ASPOSE with this functionality and ASPOSE is really expensive.

Does anyone have any idea of how to solve this? How can I get my HTML to a docx file?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Smile简单爱 2024-08-10 04:30:23

这有点难看(考虑到资源),但它是一个选项: 使用 OpenOffice 进行批量命令行文件转换。它应该能够从 HTML 转换 -> Doc(DocX 可能能够处理)。

soffice.exe -headless -nologo -norestore -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager 
python DocumentConverter.py test.html test.doc

This is somewhat ugly (considering the resources) but it's an option: Batch CommandLine FileConversion with OpenOffice. It should be able to convert from HTML -> Doc (which then DocX might be able to process).

soffice.exe -headless -nologo -norestore -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager 
python DocumentConverter.py test.html test.doc
挽你眉间 2024-08-10 04:30:23

与您寻找一个框架来完成您想要的、测试和部署解决方案的时间相比,Aspose 会那么昂贵吗?几年前,我们使用 XSLT 来创建 RTF 文档,但如果有 Aspose,那么我会根据它节省的时间来选择。

Would Aspose be all that expensive versus your time to find a framework to accomplish what you want, test, and deploy the solution? Years back we used XSLT to create RTF documents, but had Aspose been around then I would have selected just based on the time it would have saved me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文