Dim document As Document = New iTextSharp.text.Document(iTextSharp.text.PageSize.A4.Rotate, 1, 1, 1, 1) Dim UrlDirectory As [String] = Request.Url.GetLeftPart(UriPartial.Path) UrlDirectory = UrlDirectory.Substring(0, UrlDirectory.LastIndexOf("/") + 1) Response.Write(UrlDirectory) PdfWriter.GetInstance(document, New FileStream(Server.MapPath(".") + "mayur.pdf", FileMode.Create)) document.Open() ' Dim textFont As Font = FontFactory.GetFont("Helvetica", 1, 1, font.NORMAL, BaseColor.BLACK) Dim htmlText As [String] = hdpdf.Value Dim htmlarraylist As List(Of IElement) = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(New StringReader(htmlText), Nothing) ' document.SetPageSize= Dim font As Font = FontFactory.GetFont("Times-Roman", 9) For k As Integer = 0 To htmlarraylist.Count - 1 Dim x As IElement = DirectCast(htmlarraylist(k), IElement) Response.Write(x.Type.ToString() + "#<br>") Next Dim mypara As New Paragraph() ' mypara.SetLeading(0.0F, 3.0F) mypara.InsertRange(0, htmlarraylist) document.Add(mypara) document.Close()
Trim()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)