Will it possible to conver the asp.net page to pdf file.
I could convert gridview to pdf but I am not sure how to convert the whole page to pdf file.
I am using : iTextSharp thank you
I could convert gridview to pdf but I am not sure how to convert the whole page to pdf file.
I am using : iTextSharp thank you
Code:
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Response.AddHeader("content-disposition", "attachment;filename=ItemsUsedForProject.pdf")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
gvItemDetail.AllowPaging = False
gvItemDetail.DataBind()
gvItemDetail.RenderControl(hw)
Dim sr As New StringReader(sw.ToString())
Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
Dim htmlparser As New HTMLWorker(pdfDoc)
PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
pdfDoc.Open()
htmlparser.Parse(sr)
pdfDoc.Close()
Response.Write(pdfDoc)
Response.[End]()
End Sub
[code]