Arabic Text-Area Not Showing Up Correctly

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v12)  /  Arabic Text-Area Not Showing Up Correctly

DynamicPDF CoreSuite for .NET (v12) Forum

When we create a PDF and using a text area and merge Arabic data from our CRM system we don't see exactly the same value.

Original string data from CRM system:
09-1808 ، مبنى رقم7277، طابق رقم 18 برج الفيصلية، طريق الملك فهد السريع صندوق بريد 54995, الرياض,  11524

The value we see in the PDF after we build a text-area is the following.

‏8081-90 ، مبنى رقم7727، طابق رقم 81 برج الفيصلية، طريق الملك فهد السريع صندوق بريد 59945‏

We see that the numbers are a flipped and the order of text is different. We ran some test with Kerning off and on.

Can anyone help me point out what could be causing this?

Sample code:
private void InsertTestPage()
        {
            //RUN THIS TEST
            Document testDoc = new Document();
            Page testPage = new Page(PageSize.Letter, PageOrientation.Portrait);
            string arabicTest = "09-1808 ، مبنى رقم7277، طابق رقم 18 برج الفيصلية، طريق الملك فهد السريع صندوق بريد 54995";
            string arabicTest2 = "20717064 ؄؈أؤ ڲڈډۋ ڬۂ ڣڍڪٸ ڷڟہڀ";
            Font arial = new OpenTypeFont("D:\\Tempy\\arial.ttf");
            var arialKerningTest = arial.HasKerning();
            TextArea arialWithKerning = new TextArea(arabicTest, 0, 0, 2000, 2000, arial)
            {
                RightToLeft = true,
                KerningEnabled = true
            };
            testPage.Elements.Add(arialWithKerning);
            TextArea arialWithoutKerning = new TextArea(arabicTest, 0, 20, 2000, 2000, arial)
            {
                RightToLeft = true
            };
            testPage.Elements.Add(arialWithoutKerning);
            TextArea arialWithKerning1 = new TextArea(arabicTest2, 0, 200, 2000, 2000, arial)
            {
                RightToLeft = true,
                KerningEnabled = true
            };
            testPage.Elements.Add(arialWithKerning1);
            TextArea arialWithoutKerning1 = new TextArea(arabicTest2, 0, 220, 2000, 2000, arial)
            {
                RightToLeft = true
            };
            testPage.Elements.Add(arialWithoutKerning1);
           

            testDoc.Pages.Add(testPage);
            testDoc.Draw("D:\\Temp\\righttolefttest.pdf");
        }
Posted by a ceTe Software moderator - Commonly asked question
Hi,

Please try setting TextAlign property of TextArea to Right and see if it helps.

Here is a code sample.

            textAreaObj.RightToLeft = true;
            textAreaObj.Align = TextAlign.Right;

Thanks,
ceTe Software Support Team
Turned out to be a bug and addressed in version 12.22.0
The US president raged at NATO allies over defense spending in meeting with the German chancellor, as Israel ordered its military to ‘advance’ in Lebanon

All times are US Eastern Standard time. The time now is 4:57 PM.