Signature font problem

View: New views
1 Messages — Rating Filter:   Alert me  

Signature font problem

by dziedrius :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
i'm using code below to embed unicode font for signature (reason and location fields may have unicode characters), but after signing if i open pdf, it says "Cannot find or create the font "VPFLKK+ArialMT". Some characters may not display or print correctly."

May be anybody will spot the problem.

      var signatureAppearance = pdfStamper.SignatureAppearance;
            if (parameters.IsSignatureVisible)
            {
                signatureAppearance.SetVisibleSignature(parameters.SignatureRectangle, 1, null);
            }
            signatureAppearance.SignDate = DateTime.Now;
            signatureAppearance.SetCrypto(null, chain, null, null);            
            signatureAppearance.Reason = parameters.SignReason;
            signatureAppearance.Location = parameters.SignLocation;
            signatureAppearance.Acro6Layers = true;
            signatureAppearance.Render = PdfSignatureAppearance.SignatureRender.NameAndDescription;
            var dic = new PdfSignature(PdfName.ADOBE_PPKLITE, PdfName.ADBE_PKCS7_DETACHED)
                          {
                              Date = new PdfDate(signatureAppearance.SignDate),
                              Name = PdfPKCS7.GetSubjectFields(chain[0]).GetField("CN")
                          };
            if (signatureAppearance.Reason != null)
                dic.Reason = signatureAppearance.Reason;
            if (signatureAppearance.Location != null)
                dic.Location = signatureAppearance.Location;
            signatureAppearance.CryptoDictionary = dic;

            var arr = File.ReadAllBytes(@"C:\eSigner\bin\Debug\arial.ttf");
            signatureAppearance.Layer2Font = new Font(BaseFont.CreateFont("Arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true, arr, null));

            int csize = 15000;
            var exc = new Hashtable();
            exc[PdfName.CONTENTS] = csize * 2 + 2;
            signatureAppearance.PreClose(exc);