Writing arabic

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for .NET (v3 and older)  /  Re: Writing arabic

DynamicPDF Generator for .NET (v3 and older) Forum

 Oct 11 2013 8:09 AM
We're seeing issues writing Arabic text out to a PDF file. The problem is detecting we're dealing with Arabic, and switching to RightToLeft on a label. The processing of scanning cells seems to decrease performance by 50%. Is there anything you can recommend to help us with this?

Pete
 Oct 11 2013 9:06 AM
Posted by a ceTe Software moderator
Hello Pete,

The DynamicPDF Generator for .NET API adds the text to the PDF using the font set to the page elements. If the text is not getting added correctly then please make sure that you are using the correct font which has support for the Arabic characters and text.

The DynamicPDF API does not scan any of the contents before adding to the PDF. There is nothing in our API which is causing this behavior.

If you are having any issues while using our DynamicPDF APIs then please provide the more details so that we can help you further. Also you can contact our support team if you have any technical queries regarding DynamicPDF products.

Thanks,
ceTe Software Support Team.
 Oct 11 2013 12:10 PM
I'm trying to create a simple example to show the issue and I'm having problems picking the right font.
 Oct 14 2013 8:55 AM
Here's my sample code:

var document = new Document();

document.Creator = "Test";
document.Author = "Testing";
document.Title = "Checking Arabic support";

var font = new OpenTypeFont("times.ttf");

var page = new Page(PageSize.A4, PageOrientation.Portrait, 54.0f);

var arabicText = "??? ?? ???? ???? ??????, ?????";

var label = new Label(arabicText, 10.0f, 10.0f, 300.0f, 12.0f, font, 12.0f) { RightToLeft = true };

page.Elements.Add(label);
page.Elements.Add(new Label("Reference English Text", 10.0f, 50.0f, 100.0f, 12.0f, font, 12.0f));

document.Pages.Add(page);

document.Draw("Testing.pdf");

What this produces is a PDF file with Arabic but not in the cursive style - looks like individual letters (can't paste it here as it gets changed).
 Oct 14 2013 9:23 AM
The Arabic text has been lost in the forum, I've emailed you the source code and output.
 Oct 14 2013 11:19 AM
Posted by a ceTe Software moderator
Hello,

Thank for sending the code and PDF. We have looked into the information you have sent. The shape of the Arabic characters differs depending on which position in a word they appear on. The cursive style of Arabic text you are seeing in Visual Studio and/or text editors like MS Word is a result of character shaping. The reason you are seeing the individual characters on the PDF is because the DynamicPDF Generator for .NET does not support character shaping. We have this feature added to our feature request list and at this time we have no immediate plans to implement this feature.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 11:20 AM.