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 :
|
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!
|