// convert HTML to PDF byte[] pdfBuffer = null; try {
pdfBuffer = htmlToPdfConverter.ConvertHtmlToMemory(data, Request.Url.ToString()); // inform the browser about the binary data format HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf"); // let the browser know how to open the PDF document HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=Report-" + globalFunctions.ConvertUTCToLocal(DateTime.UtcNow).ToShortDateString() + ".pdf"); // write the PDF buffer to HTTP response HttpContext.Current.Response.BinaryWrite(pdfBuffer);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)