Issue with arabic language using itextsharp vb.net
I am using iTextSharp to convert HTML to pdf that has arabic and english characters,. I was able to show the English characters, but no luck with the arabic ones. I am using below code
Code:
Dim bf As BaseFont = BaseFont.CreateFont("c:\windows\fonts\arial.ttf", BaseFont.IDENTITY_H, True)
Using sw As StringWriter = New StringWriter()
Using hw As HtmlTextWriter = New HtmlTextWriter(sw)
Me.Page.RenderControl(hw)
Dim sr As StringReader = New StringReader(sw.ToString())
Dim pdfDoc As Document = New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
Dim writer As PdfWriter = PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
pdfDoc.Open()
Dim font As New iTextSharp.text.Font(bf, 10, iTextSharp.text.Font.NORMAL)
XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, sr)
pdfDoc.Close()
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Write(pdfDoc)
Response.End()
End Using
End Using
Re: Issue with arabic language using itextsharp vb.net
Seems you need Arial Unicode, instead of basic Arial?