Posted on: 5/2/2013 11:25:32 AM | Views : 217

HtmlForm form = new HtmlForm(); form.Controls.Add(GridView1); StringWriter sw = new StringWriter(); HtmlTextWriter hTextWriter = new HtmlTextWriter(sw); form.Controls[0].RenderControl(hTextWriter); string html = sw.ToString(); Document Doc = new Document(); //PdfWriter.GetInstance //(Doc, new FileStream(Request.PhysicalApplicationPath //+ "\\AmitJain.pdf", FileMode.Create)); PdfWriter.GetInstance(Doc, new FileStream(Environment.GetFolderPath (Environment.SpecialFolder.Desktop)+ "\\AmitJain.pdf", FileMode.Create)); Doc.Open(); Chunk c = new Chunk("Export GridView to PDF Using iTextSharp \n",FontFactory.GetFont("Verdana", 15)); Paragraph p = new Paragraph(); p.Alignment = Element.ALIGN_CENTER; p.Add(c); Chunk chunk1 = new Chunk(" ...

Go to the complete details ...