Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,
I have to convert the html into image in my web api. its all done(namespace :
CoreHtmlToImage
). but while deploy it in Docker the code is not working as expected. image conversion is not happening.

is any supporting dlls should i install

Kindly help me to resolve this.



Thanks in advance

What I have tried:

var converter = new HtmlConverter();
                var html = stringbuilderObj.ToString();
                var bytes = converter.FromHtmlString(html, 400, ImageFormat.Png);
                var rootpath = Path.Combine("Config", "Images");
                if (!Directory.Exists(rootpath))
                {
                    Directory.CreateDirectory(rootpath);
                }
                File.WriteAllBytes(rootpath + "\\" + name.Replace(" ", string.Empty) + ".png", bytes);
Posted
Comments
Member 15329613 16-Sep-21 10:52am    
Do you get any errors?
avelsamy 17-Sep-21 2:51am    
Yes, i got below exception
System.Exception: wkhtmltoimage does not appear to be installed on this linux system according to which command; go to https://wkhtmltopdf.org/downloads.html

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