Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Word to HTML then render HTML on webpage

Tags:

c#

ms-word

I have a tough project in my pipeline and I'm not sure where to begin. My boss wants the ability to display a Word Document in HTML and it look the same as the word document.

After trying time after time to just let me show the word document in a pop up or a light box he is stuck on stripping out the contents of the word converting it to HTML saving that in a database and then displaying it as HTML on a webpage.

Can you guys either give me some good ammo as to if showing the word document is better (less cumbersome, less storage space more secure etc).

Or if it's pretty easy to convert a word document to HTML ways for me to do that.

The technologies I current have are Entity Framework, LINQ, MVC, C#, Razor.

We currently use HTmlAgilityPack, but this strips out all of the formatting and doesn't allow the document to show very well.

like image 839
James Wilson Avatar asked Aug 15 '13 16:08

James Wilson


1 Answers

We use http://www.aspose.com/ (I think the one we use is Aspose words) to perform s similar task, and it works quite well. (there is a cost involved)

I would suggest that converting to HTML gives the worst rendition of the document. One solution we use, is to generate a Jpeg image of the document and display that.

If you need to be able to perform operations like find and copy/pasting text - I would recommend converting the document to a .pdf, and displaying it inline, in whichever standard pdf viewer the client machine has installed.

like image 127
Dave Bish Avatar answered Oct 21 '22 14:10

Dave Bish