VB.NET
<pre lang="C#">I am using itexhsharp to generate , On local server it is working but giving me warning iTextSharp.text.html.simpleparser.HTMLWorker is absolote and On the server it is not working and not generating pdf file any one can give me solutions for this error</pre>My code is here :
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment;filename=Vasundhara" + Date.Today + ".pdf")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
repeaterName.RenderControl(hw)
Dim sr As New StringReader(sw.ToString())
Dim pdfDoc As New Document(PageSize.A4, 50.0F, 50.0F, 40.0F, bottom)
Dim htmlparser As New HTMLWorker(pdfDoc)
PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
pdfDoc.Open()
Try
htmlparser.Parse(sr)
Catch ex As Exception
Finally
pdfDoc.Close()
End Try
'htmlparser.Parse(sr)
'pdfDoc.Close()
Response.Write(pdfDoc)
Response.End()


Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 2, 2016, 7:52 PM EST
Hi Aman,
Please put
If the above solution is helpful then,accept the answer.
Mohammad AmanRank #4,571 · 337 reputationPosted Mar 3, 2016, 12:11 AM EST
Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 3, 2016, 1:43 AM EST
Hi Aman,
In that case use xmlworkerhttp://jwcooney.com/2012/12/30/generate-a-pdf-from-an-asp-net-web-page-using-the-itextsharp-xmlworker-namespace/