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?