在.net将HTML转换为Word [英] Converting Html to Word in .Net

查看:256
本文介绍了在.net将HTML转换为Word的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要建立从HTML内容(在ASP.NET服务器应用程序)的Word文件,但无法找到这样做的一个可靠的方法。于是决定在这里运行的讨论,看看这样做的可能选项。

I need to create a word file from a HTML content (on a ASP.NET server application) but couldn't find a robust way of doing that. So decided to run a discussion here to see what are possible options of doing this.

阅读Aspose有 .NET组件了解这一点,但价格如此之高,所以不能(由于预算问题)的解决方案。

Aspose has a .NET component for this but the price is so high so can not be a solution (due to budgeting issues).

我们预计这一转化为preserve表格,图片,隐藏不可见元素,链接等。

We expect this conversion to preserve tables, images, hiding invisible elements, links, etc.

有一个类似的讨论这里但所提供的解决方案都是围绕办公室互操作是不是服务器应用程序推荐的解决方案。

There is a similar discussion here but solutions provided are all around Office Interop which is not a recommended solution for server application.

你知道吗?基本上,你怎么样组件的Aspose工作?

Any idea? Basically how do components like Aspose work?

推荐答案

我会使用openxml API,你可以浏览DOM和编程元素添加到word文档建议写作code。它通过你既然是跨pretting标记,并试图将其转换非易事。

I would suggest writing code using the OpenXml API, you can navigate the DOM and programmatically add elements to the word document. Its no simple task through since you are interpretting markup and attempting to convert it.

链接,打开XML: HTTP:// WWW .microsoft.com /下载/ EN / details.aspx displaylang = EN&放大器;?ID = 5124

这篇关于在.net将HTML转换为Word的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆