Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
Hi Good Morning


I am trying to convert my html tables to image format,
i have tired to google but most of answer are for url converting,

Can any help with link or code to convert html to image
i have HTML Table LIke

XML
_sb.Append("<table><thead><tr><th  style='text-align:right;padding:4px;padding-removed12px;font-weight:bold;'>" + HeaderValue + "</th></tr></thead>");


i want to convert this table to image and i will send that image to pdf


The Html is in string builder
Posted
Updated 2-Sep-15 21:24pm
v2
Comments
Sarath kumar.N 3-Sep-15 2:29am    
Any idea about height of the image?
murkalkiran 3-Sep-15 2:43am    
thanku for u r replay

What ever the height
Sarath kumar.N 3-Sep-15 2:56am    
You are talking about current view of the webpage or entire page?
Sergey Alexandrovich Kryukov 3-Sep-15 2:34am    
Why? It sounds as a quite bad technology abuse.
—SA
murkalkiran 3-Sep-15 2:44am    
i am beginner sir

You can suggest me any other method to do this task

There are numerous third party tools available.

One such example is "iTextSharp" , its a free .NET API for PDF Related operations. It has a iTextSharp.text.html.HtmlParser class for parsing and converting the html to PDF.

I've never used it, but it seems to be popular choice, given the number of questions floating around it.


There are also Code project articles doing the same[^]

And Commercial libraries too[^]

If you're using Visual Studio check NuGet libraries[^]

Some others[^]

And more[^]


All found by 5 minutes of googling. Good luck.

If this helps, please accept the solution. Thank you.


P.S: Just in case you really need the image instead of PDF, this last tool [^] enables you to do that.
 
Share this answer
 
v2
Use Html Renderer dll. It supports converting html content to image
https://htmlrenderer.codeplex.com/#[^]


http://amoghnatu.net/2013/05/13/converting-html-text-to-image-using-c/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900