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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With