Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
How to convert div.innerhtml to PDF. I used itextsharp for convert to PDF. but textbox and sigplus(Activex signature) controls are not converted and it displayed empty field in PDF.
Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
                PdfWriter.GetInstance(pdfDoc, System.Web.HttpContext.Current.Response.OutputStream)
                pdfDoc.Open()
                Dim htmlarraylist As ArrayList = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(New StringReader(HtmlDiv.InnerHtml), Nothing)
                For k As Integer = 0 To htmlarraylist.Count - 1
                    pdfDoc.Add(DirectCast(htmlarraylist(k), IElement))
                Next
                pdfDoc.Close()
                Response.ContentType = "application/pdf"
                Response.AddHeader("content-disposition", "attachment;filename=" & DateTime.Now.ToString("ddMMyyyyHHmm") & ".pdf")
                System.Web.HttpContext.Current.Response.Write(pdfDoc)
                Response.Flush()
                Response.[End]()
Posted 5-Feb-13 22:29pm
Sugu.s482
Edited 6-Feb-13 3:12am
105.4K
v3
Comments
Tadit Dash at 6-Feb-13 6:56am
   
Please post codes what have you tried so far.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 563
1 George Jonsson 258
2 OriginalGriff 250
3 CPallini 210
4 PIEBALDconsult 145
0 OriginalGriff 5,865
1 Sergey Alexandrovich Kryukov 5,316
2 CPallini 4,760
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100