Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Here is my code, Please try to help me out from this problem.
Thanking You !!

C#
// convert HTML to PDF
   byte[] pdfBuffer = null;
   try
   {

VB
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);


}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900