如何在ASP.NET C#中将HTML转换为图像文件
问题描述:
我有以下HTML
I have the following html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Happy Birthday</title>
</head>
<body background="http://172.17.200.54/Bday_Mail_Template/BG_2.jpg">
<div style='width: 100%; height: auto; float: left;'>
<div style='font-size: 24px; width: 100%; float: left;'>
Dear User,
</div>
<div style='font-size: 22px; line-height: 50px; width: 100%; float: left; text-align: center; margin-top: 40px;'>
Wish you a very happy Birth day.
</div>
<div style='font-size: 18px; letter-spacing: 1px; font-style: italic; width: 100%; float: left; margin-top: 50px;'>
Best Wishes,
<br />
HR Team<br />
Test Company Ltd
<br /><br />
<span style="color:Red;">***Note - </span> This is a system generated email,please do not reply.
</div>
</div>
</body>
</html>
我尝试过:
我正在尝试将html转换为图片但不能
What I have tried:
I am trying to convert html to image but can't
答
谷歌是你的朋友......找到以下链接使用此搜索: c#将html转换为图片 - Google [ ^ ]
* c# - 将HTML字符串转换为图像 - Stack Overflow [ ^ ]
Google is your friend... Found the link below with this search: c# convert html to image - Google[^]
* c# - Convert HTML string to image - Stack Overflow[^]