Form filling in Arabic

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Form filling in Arabic

DynamicPDF CoreSuite for .NET (v5) Forum

 Oct 19 2009 4:00 AM
Hi,
I want to fill out the forms in Arabic. I use CreateLabel method for filling out. But if I use Arabic I cannot see my information on the form.
Are there any ways to use CreateLabel method for filling out the forms in Arabic?
 Oct 19 2009 9:15 AM
Posted by a ceTe Software moderator
Hello,

You will have to use any OpenType or Type1 fonts in the CreateLabel method that has support for Arabic characters.

Thanks,
ceTe Software Support Team
 Oct 21 2009 7:05 AM
Hi.
I use the code below to test two ways of filling form. I fill form in Arabic.
The code generate 3 files. The first file is a template. The template contains two fields. The second file has first field filled. The 3rd file has both fields filled.
The fields are filled with same values, but result is different. The text in first field is equal to '???????- ??????' (it is right). But second field has another text (it is wrong).
How can I fix it?

Document document = new Document();
Page page = new Page();

page.Elements.Add(new TextField("atxt1", 100, 100, 300, 50));
page.Elements.Add(new TextField("atxt2", 100, 200, 300, 50));

document.Pages.Add(page);
document.Draw(@"doc.pdf");

MergeDocument mergeDocument1 = new MergeDocument(@"doc.pdf");
mergeDocument1.Form.Fields["atxt1"].Value = "???????- ??????";
mergeDocument1.Draw(@"doc1.pdf");

PdfDocument pdfDocument = new PdfDocument(@"doc1.pdf");
MergeDocument mergeDocument = new MergeDocument(pdfDocument, MergeOptions.Append);
OpenTypeFont openTypeFont = new OpenTypeFont("COUR.TTF");
pdfDocument.Form.Fields["atxt2"].CreateLabel(mergeDocument.Pages[0], "???????- ??????", openTypeFont, 12);

mergeDocument.Draw(@"doc2.pdf");
System.Diagnostics.Process.Start("doc2.pdf");

P.S. How can I make this code easier?
 Oct 21 2009 7:17 AM
I cannot post the arabic word that is used in code above.
 Oct 21 2009 7:24 AM
It looks like the second field has the value with arabic symbols that were written from the left to the right, but not from the right to the left.
 Oct 21 2009 9:59 AM
Posted by a ceTe Software moderator
Hello,

In order to display the Arabic text you will have to use a True Type, Open Type or Type1 font which supports the Arabic text. It is not possible to display Arabic text without using the font files.

In the first case you are actually filling the field with some Arabic text and the field do not have the Arabic text support, you may not see the Arabic text properly in this case.

In the second case you are using some font file, if it supports Arabic then you can display the Arabic text. The CreateLabel method will display text normally and not in right to left fashion.

In order to display the text right to left you will have to use the Label page element which has a property RightToLeft. You will have to add a label on the field by getting the X, Y width and height of the field. This should solve your problem.

Thanks,
ceTe Software Support Team.
 Oct 22 2009 8:12 AM
Hi!
Thanks for your reply.
I use the RightToLeft property. And symbols are written from the right to the left. But the symbols do not connect together. It is wrong. Can I fix this?
 Oct 22 2009 9:15 AM
Posted by a ceTe Software moderator
Hello,

Are you talking about the combining two or more characters to make a single character. Our product does not sample the text to know when to make these conjuncts for successive consonants. The sampling of the text and determining the exact character to use by the context in which it is used is not automatically a PDF feature. Some software (like MS Word) will detect, from context, which glyph to use. Combining the characters which makes a single characters is not a feature available in our product.

You will have to use the exact Unicode value for the characters that within its context would need to be used when using our product.

You can look on the Unicode website and click on Arabic to know the specific Unicode value for a certain character.

Thanks,
ceTe Software Support Team.

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