图书馆的Word文档文本转换为HTML [英] Library to convert Word document text to HTML

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

问题描述

有一个.net开源库字dococument转换为HTML的网页里显示。

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

我知道了几个工具来转换Word文档到HTML文件,但我的要求是要转换的文档(无论是从文件或只是提取的文本)成HTML在ASP.Net应用程序的飞行。

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.

我找到了<一个href=\"http://stackoverflow.com/questions/198721/converting-a-word-document-into-usable-html-in-php\">converting-a-word-document-into-usable-html-in-php PHP库做同样的事情,有没有.NET任何类似的工具?

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?

推荐答案

您只是想要一个* .doc文件转换为HTML?被保存为HTML文件的选项?

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

有是标准的具有保存为HTML选项 .SaveAs 方法:

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

wdFormatHTML 保存所有文本和格式的HTML标签,这样所产生的文件可以在Web浏览器中查看。

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

来自: MSDN SaveAs方法

这是如何使用的方法为.doc转换成不同的格式,你可以在这里找到一个实例教程:的如何使用C# DOC转换为其他格式。

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#.

如果您有* .DOCX文件,而不是* .doc文件,因为你使用的OpenXML API这里像在MSDN上解释它更容易-us /库/ bb656295%28office.12%29.aspx相对=nofollow>处理的Word 2007文件的Open XML格式API (1 3的一部分)。如果你得到了这个词的XML文件,你可以吗?当然输出到任何格式(HTML)你想要的。的

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.

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

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