Writing arabic

Writing arabic

Forum member · Oct 11, 2013
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

Re: Writing arabic

Support · Oct 11, 2013
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 [^a|mailto:support@cete.com|opennewwindow|support ^] team if you have any technical queries regarding DynamicPDF products. Thanks, ceTe Software Support Team.

Re: Writing arabic

Forum member · Oct 11, 2013
I'm trying to create a simple example to show the issue and I'm having problems picking the right font.

Re: Writing arabic

Forum member · Oct 14, 2013
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).

Re: Writing arabic

Forum member · Oct 14, 2013
The Arabic text has been lost in the forum, I've emailed you the source code and output.

Re: Writing arabic

Support · Oct 14, 2013
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.