-1

I am trying to sign a PDF file using a certificate that its subject name in Arabic. Signature appearance doesn't show text correctly, the text direction should be RTL. For example, instead of "عربي" it appears "ي ب ر ع"

 PdfFont fontTest = PdfFontFactory.CreateFont(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "Tahoma.ttf"), PdfEncodings.IDENTITY_H, true);
PdfString pdfString = new PdfString("Digitally signed by\n " + cert.IssuedTo + "\n Date:" + DateTime.Now);
PdfSignatureAppearance appearance = signer.GetSignatureAppearance();
                        
appearance.SetReuseAppearance(false)
          .SetPageRect(rect)
          .SetPageNumber(pageNmber)
          .SetLayer2Font(fontTest)
          .SetLayer2Text(pdfString.ToString())
                            .SetRenderingMode(PdfSignatureAppearance.RenderingMode.NAME_AND_DESCRIPTION) ;
                       
Menna
  • 1
  • 2

1 Answers1

1

In iText 7 there is a separate add-on that facilitates complex script support. To enable support for complex scripts in iText 7, use iText pdfCalligraph add-on

Alexey Subach
  • 11,903
  • 7
  • 34
  • 60