Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library to convert Word document text to HTML [closed]

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

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.

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?

like image 502
RameshVel Avatar asked Oct 19 '10 10:10

RameshVel


People also ask

How do I convert a Word document to HTML?

Using MS Words built-in save as HTML optionGo to the file menu. Select Save as. In the drop-down file type box select, Web Page, Filtered. Click Save.


1 Answers

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

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

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

from: MSDN SaveAs Method

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

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.

like image 151
Dennis G Avatar answered Oct 06 '22 23:10

Dennis G