Welcome Guest Search | Active Topics | Sign In | Register

Arabic text display left to right instead of right to left using PdfCreator and C# Options
LudovicPithon
Posted: Wednesday, December 19, 2018 5:18:49 AM
Rank: Newbie
Groups: Member

Joined: 12/19/2018
Posts: 1
Hello,

When I add an arabic string to a PDF with PdfCreator, the generated PDF display string left to right.

With:
Code: C#
var str = "ﺏﻧﻌﻠﺍ ﻚﻮﺷﻠﺍ ﻥﻤ ﻲﻧﺠﺘ ﻻ ﻚﻧﺇ";

I get :
إنك لا تجني من الشوك العنب

Do I miss something ?
Thanks for you help


The full project code :
Code: C#
using EO.Pdf;
using EO.Pdf.Acm;
using System;
using System.IO;

namespace PdfArabicTest
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var pdfDocument = new PdfDocument();
            var pageLayout = new AcmPageLayout(new AcmPadding(0.3f));
            var renderer = new AcmRender(pdfDocument, pageLayout);

            var str = "ﺏﻧﻌﻠﺍ ﻚﻮﺷﻠﺍ ﻥﻤ ﻲﻧﺠﺘ ﻻ ﻚﻧﺇ";

            var strArray = str.ToCharArray();
            Array.Reverse(strArray);

            renderer.Render(new AcmText(str));
            renderer.Render(new AcmText("        string: " + str + " test"));
            renderer.Render(new AcmText("reverse string: " + new string(strArray) + " test"));

            using (FileStream pdfStream = new FileStream("pdf.pdf", FileMode.Create, FileAccess.Write))
            {
                pdfDocument.Save(pdfStream);
            }
        }
    }
}


The full result :
eo_support
Posted: Wednesday, December 19, 2018 10:06:30 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

The ACM interface does not support right to left. However the HTML to PDF interface should support right to left text. So you can try that and see if it works for you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.