Wednesday, September 14, 2011

How do I convert an html page to MHTML (Web Archive) format using .net code?

How do I convert an html page to MHTML (Web Archive) format using .net code?

MHTML format is the web archive option that bundles the web page and all of its references into a single compact .MHT file. It's a lot easier to distribute a single self-contained file than it is to distribute a HTML file with a subfolder full of image/CSS/Flash/XML files referenced by that HTML file.
If you are using a Document Management System to check HTML reports or something then you the system would expect only 1 file as INPUT. In that scenario, web archive options (MHTML) works well. Here is the code that can be referenced on codeplex that can help achieve this.

http://www.codeproject.com/KB/files/MhtBuilder.aspx

No comments: