Waqas Ali

Waqas Ali

  • NA
  • 6
  • 7.7k

ITextsharp not displaying ARABIC data

Jul 25 2014 4:21 PM

I am making a report.following is a code and sample.I am using html table for reports.When I run the code pdf is successfully generated but

Arabic is not showing.Can you guide me how can i embed Arabic in it.Can you modify

my following code which shows arabic  data.

Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf");
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            StringWriter sw = new StringWriter();
            HtmlTextWriter hw = new HtmlTextWriter(sw);
            tblid1.RenderControl(hw);
            StringReader sr = new StringReader(sw.ToString());
            Document pdfDoc = new Document(PageSize.A4, 80f, 80f, -2f, 35f);
            HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
            PdfWriter writer = PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
            pdfDoc.Open();
            htmlparser.Parse(sr);
            pdfDoc.Close();
            Response.Write(pdfDoc);
            Response.End();

<table id="tblid1" runat="server">

<tr>

   <td>???????????</td>

<td>?????</td>

</tr>

</table>


Answers (2)