Posted on: 6/11/2014 9:19:45 PM | Views : 433

Hi All,
I downloaded the iTextSharp.dll with nuget and trying to export the gridview to pdf, but whenever I tried to open this pdf file, I get an error saying "There was an error opening this document. the file is damaged and could not be repaired.
Below ius my code
Imports System.Globalization Imports System.IO Imports iTextSharp.text Imports iTextSharp.text.pdf Imports iTextSharp.text.html Imports iTextSharp.text.html.simpleparser Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Try ds = SelectionCriteria.GetPDFExport() grdReport.DataSource = ds grdReport.DataBind() Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Response.AddHeader("content-disposition", "attachment;filename=student.pdf") Response.Cache.SetCacheability( ...

Go to the complete details ...