Click here to Skip to main content
12,406,124 members (63,130 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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.s527
v3
Comments
Tadit Dash 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160726.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2016
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