locked
ITextsharp not displaying ARABIC data when converting html table data to PDF RRS feed

  • Question

  • 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>

    • Moved by Mike Danes Friday, July 25, 2014 6:01 PM not BCL
    Friday, July 25, 2014 12:50 PM

Answers

  • ITextsharp is not part of .Net. Ask its developers at http://itextpdf.com/support instead.


    Visual C++ MVP

    • Proposed as answer by Just Karl Wednesday, September 10, 2014 3:41 PM
    • Marked as answer by Just Karl Monday, September 22, 2014 9:21 PM
    Friday, July 25, 2014 2:28 PM