Nuget 引入 OpenHtmlToPdf
using (WebClient wc = new WebClient())
{
wc.Encoding = Encoding.UTF8;
wc.UseDefaultCredentials = true;
string html = wc.DownloadString(URL); var document = Pdf.From(html); var result = document.Content(); var ms = new System.IO.MemoryStream(result);
var fn = string.Format("quotation_{0}", filenme); return new Attachment(ms, fn, "application/pdf");
}