Convert HTML string to image

后端 未结 4 805
终归单人心
终归单人心 2020-11-27 13:00

I have a string variable which holds HTML markup. This HTML markup basically represents the email content.

Now I want to create an image from this string content whi

4条回答
  •  生来不讨喜
    2020-11-27 13:28

           
            
    
            
    
            
             
    
    
    
    
    
    

    protected void ExportToImage(object sender, EventArgs e) { string base64 = Request.Form[hfImageData.UniqueID].Split(',')[1]; byte[] bytes = Convert.FromBase64String(base64); Response.Clear(); Response.ContentType = "image/png"; Response.AddHeader("Content-Disposition", "attachment; filename=name.png"); Response.Buffer = true; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.BinaryWrite(bytes); Response.End(); }

提交回复
热议问题