Convert HtmlToPDF in ASP.net & iTextshrap
Convert Web Page to PDF in ASP.net & iTextshrap Step 1 Download iTextSharp dll from below link's Download iTextSharp dll iTextsharp_Dll Download Step 2 Create a sample website in .net . Add reference the downloaded dll . Step 3 Create a page and design you report in this web page and put one button for Export to pdf . Step 4 C# Add namespaces below . using System.IO; using iTextSharp.text; using iTextSharp.text.html.simpleparser; using iTextSharp.text.pdf; using System.Text; Copy and Paste below code in Export Button click event . Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); ...
Comments
Post a Comment