Is there a .Net open source library to convert the word dococument to HTML to display inside the webpage.

是否有.Net开源库将单词dococument转换为HTML以显示在网页内。

I know several tools to convert word docs to html files, but my requirements is to convert the doc(either from the file or just extracted text) to HTML on the fly in the ASP.Net application.

我知道几种将word文档转换为html文件的工具,但我的要求是在ASP.Net应用程序中将文档(从文件或刚刚提取的文本)转换为HTML。

I found the converting-a-word-document-into-usable-html-in-php PHP library do the same thing, is there any similar tool in .net?

我发现转换-a-word-document-into-useful-html-in-php PHP库做同样的事情,.net中是否有类似的工具?

2 个解决方案

#1


2

You just want to convert a *.doc file to HTML? Is saving it as a a HTML file an option?

您只想将* .doc文件转换为HTML?将它保存为HTML文件是一种选择吗?

There is the standard .SaveAs method which has the option to save as HTML:

有标准.SaveAs方法,可以选择保存为HTML:

wdFormatHTML Saves all text and formatting with HTML tags so that the resulting document can be viewed in a Web browser.

wdFormatHTML使用HTML标记保存所有文本和格式,以便可以在Web浏览器中查看生成的文档。

from: MSDN SaveAs Method

来自:MSDN SaveAs方法

An example tutorial on how to use the method to convert .doc to a different format you can find here: How to convert DOC into other formats using C#.

有关如何使用该方法将.doc转换为不同格式的示例教程,您可以在此处找到:如何使用C#将DOC转换为其他格式。

If you have *.docx files instead of *.doc files it is even easier because you get to use the OpenXML API like explained on MSDN here: Manipulating Word 2007 Files with the Open XML Format API (Part 1 of 3). And if you get the XML of the Word file you can of course output it to any format (HTML) you want.

如果你有* .docx文件而不是* .doc文件,那么它就更容易了,因为你可以像在MSDN上解释的那样使用OpenXML API:使用Open XML Format API处理Word 2007文件(第1部分,共3部分)。如果您获得Word文件的XML,您当然可以将其输出为您想要的任何格式(HTML)。

更多相关文章

  1. 在CSDN下载资源,扣了积分,下载的是一个404页面的html文件
  2. html5结合flash实现视频文件在所有主流浏览器兼容播放
  3. iis aspx常见错误 HTTP 错误 404 - 文件或目录未找到。
  4. 急死我了!我以前用DREAMWEAVER编写的HTML文件突然变成乱码了!!!
  5. html页面输出pdf格式文件(一步步很详细)
  6. commons-fileupload文件上传、下载
  7. Eclipse中以html格式高亮显示velocity文件
  8. 将PHP代码添加到.html文件
  9. 性能权衡 - CSS效率,CSS文件大小,HTML文件大小

随机推荐

  1. 我在解析JSON时出错了
  2. Jquery---定时器(实现页面内定时弹出广告,
  3. jquery datatables-一个数据表中的最大列
  4. jQuery 点击div, 向上展示内容
  5. 拒绝拖放到tabel的第一个子单元格
  6. 使用JQuery显示和隐藏不同div的onClick事
  7. IE 10和11中的灰度?
  8. 如何让代码等待好/取消按钮选择?
  9. jquery刷新iframe页面的方法
  10. jQuery - 加载gif的延迟显示