日期:2014-05-17 浏览次数:20445 次
[HttpPost] [ValidateInput(false)] public FilePathResult GenererPDF(string strHtml) { 《《《《《《《《《已经完成的代码》》》》》》》》 pdfBytes = pdfConverter.GetPdfBytesFromHtmlString(strHtml); <<<<<我需要的代码>>>> }
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.Clear(); response.AddHeader("Content-Type", "application/pdf"); response.AddHeader("Content-Disposition", String.Format("attachment; filename=GettingStarted.pdf; size={0}", pdfBytes.Length.ToString())); response.BinaryWrite(pdfBytes); response.End();