Html table (text) to image using C# Html table (text) to image using C# asp.net asp.net

Html table (text) to image using C#


You can use the WebBrowser.DrawToBitmap method. Here is an example. So what I would do is create a page dynamically with the table you want, and nothing but the table, then use the DrawToBitmap method to save it to an image file.


Converting HTML to bitmap is difficult task. You will need first a rendering engine capable of handling HTML and optionally javascript and css (in case you want to support them). Using a WebBrowser control could be done but there might be better ways.