[Solved] PDF - SignExistingField

2 Answers 79 Views
Documentation
Alexandre
Top achievements
Rank 1
Alexandre asked on 14 Aug 2026, 03:37 PM

Hello,

I'm signing a PDF field with a signature using the "SignExistingField" that exists in the PdfStreamSigner (Telerik version 2026.2.520.462)

I can see the signature in the field but the signature properties that i set ex: Reason, will show allways empty.

Thanks

2 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 18 Aug 2026, 12:23 PM

Hi Alexandre,

I created a sample project for signing a PDF document and setting signature properties like Reason and Location. I used the following sample implementation shown in the Getting Started with Digital Signature article:

int signatureFieldWidth = 200; int signatureFieldHeight = 50; int signaturePositionLeft = 10; int signaturePositionTop = 10; X509Certificate2 certificate = new X509Certificate2("..\\..\\..\\JohnDoe.pfx", "johndoe"); SignatureField pdfSignature = new SignatureField("SignatureField"); pdfSignature.Signature = new Signature(certificate);

pdfSignature.Signature.Properties.Reason = "I am the author of this document."; pdfSignature.Signature.Properties.Location = "My City, My Country"; Form pdfForm = new Form(); pdfForm.FormSource = new FormSource(); pdfForm.FormSource.Size = new Size(signatureFieldWidth, signatureFieldHeight); FixedContentEditor editor = new FixedContentEditor(pdfForm.FormSource); pdfForm.Position.Translate(signaturePositionLeft, signaturePositionTop); editor.DrawText($"{certificate.GetNameInfo(X509NameType.SimpleName, false)} {DateTime.Now.ToString("yyyy.MM.dd HH:mm")}"); SignatureWidget signatureWidget = pdfSignature.Widgets.AddWidget(); signatureWidget.Content.NormalContentSource = pdfForm.FormSource; signatureWidget.Rect = new Rect(signaturePositionLeft, signaturePositionTop, signatureFieldWidth, signatureFieldHeight); signatureWidget.RecalculateContent(); RadFixedDocument document = new RadFixedDocument(); RadFixedPage pdfPage = document.Pages.AddPage(); pdfPage.Annotations.Add(signatureWidget); FixedContentEditor pageEditor = new FixedContentEditor(pdfPage); pageEditor.Position.Translate(signaturePositionLeft, signaturePositionTop); pageEditor.DrawForm(pdfForm.FormSource); document.AcroForm.FormFields.Add(pdfSignature); signatureWidget.RecalculateContent(); string signedDocumentFilePath = "..\\..\\..\\signed.pdf"; File.Delete(signedDocumentFilePath); using (Stream output = new FileStream(signedDocumentFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider().Export(document, output, TimeSpan.FromSeconds(10)); } var psi = new ProcessStartInfo() { FileName = signedDocumentFilePath, UseShellExecute = true }; Process.Start(psi);

On my end, examining the result file and signature in Adobe Acrobat, I am able to see the set properties:

I am attaching the project for your disposal. Feel free to examine it and compare implementations. Let me know if there is something different on your end that might affect the results you are seeing or if I'm missing something. If you can, please provide your implementation instead so I can test and investigate it.

NOTE: Please keep in mind that this is a public Q&A forum thread, so any resources shared here will be publicly accessible. Please avoid sharing confidential, sensitive, or personally identifiable information.

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alexandre
Top achievements
Rank 1
commented on 30 Sep 2026, 02:41 PM

Hello,

Thanks for the answer!

Following the example in the "signing-existing-signature-fields" article, I am applying the Reason and Location properties and then applying the signature... but I don't see the properties in the PDF!

Thanks, Alexandre

My Code:

// 1. Load the existing PDF that contains unsigned signature fields.
            Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider provider =
                new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
            RadFixedDocument document;

            using (FileStream inputFile = File.OpenRead(@"C:\PDF_With_signatures.pdf"))
            {
                document = provider.Import(inputFile, Timeout.InfiniteTimeSpan);
            }

            // 2. Collect the names of all unsigned signature fields.
            string[] unsignedFieldNames = document.AcroForm.FormFields
                .Where(f => f.FieldType == FormFieldType.Signature)
                .Cast<SignatureField>()
                .Where(f => f.Signature == null)
                .Select(f => f.Name)
                .ToArray();

            // 3. Load the certificate used for signing.
            System.Security.Cryptography.X509Certificates.X509Certificate2 certificate = new X509Certificate2(@"JohnDoe.pfx", "johndoe");

            // 4. Sign each field sequentially using incremental updates.
            //    Each iteration reads the current PDF, signs one field, and produces
            //    a new stream that becomes the input for the next iteration.
            MemoryStream currentStream = new MemoryStream(File.ReadAllBytes(@"C:\lixo\PDF Digital Signature\PDFs\ARP\PDF_com_2CamposAss_NaoAssinados_Export.pdf"));

            for (int i = 0; i < unsignedFieldNames.Length; i++)
            {
                MemoryStream outputStream = new MemoryStream();
                PdfStreamSigner signer = new PdfStreamSigner(outputStream);

                Telerik.Windows.Documents.Fixed.Model.DigitalSignatures.Signature signatureVar =
                    new Telerik.Windows.Documents.Fixed.Model.DigitalSignatures.Signature(certificate);

                signatureVar.Properties.Reason = "I am the author of this document.";
                signatureVar.Properties.Location = "My City, My Country";

                signer.SignExistingField(currentStream, unsignedFieldNames[i], signatureVar);

                currentStream = outputStream;
            }

            // 5. Save the fully signed PDF to disk.
            currentStream.Seek(0, SeekOrigin.Begin);
            
            using (FileStream outputFile = File.Create(@"C:\PDF_signed.pdf"))
            {
                currentStream.CopyTo(outputFile);
            }
0
Yoan
Telerik team
answered on 05 Oct 2026, 11:08 AM

Hello Alexandre,

Thank you for the clarification, and please accept my apologies for the earlier misunderstanding.

In my initial investigation, I was creating a new PDF document and adding a signature field during the export process. After reviewing your exact scenario, where an existing signature field is signed using PdfStreamSigner, I was able to reproduce the same behavior on my side. Even when the signature properties are explicitly set through PdfStreamSigner, they are not preserved after export.

As this is the first time this issue has been reported to us, I have logged it on your behalf in our Feedback Portal: PdfProcessing: PdfStreamSigner: Setting signature Properties is not preserved after export.

Thank you for bringing this to our attention. As a small token of appreciation for the time and effort spent investigating the issue with us, I have also updated your Telerik Points.

I understand this may be causing inconvenience, and I sincerely apologize for that. Unfortunately, I am not aware of a viable workaround at this time. If this issue is important to your project, I encourage you to subscribe to the feedback item. Doing so will allow you to track its progress and receive notifications whenever there are updates from our development team.

Regards,


Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alexandre
Top achievements
Rank 1
commented on 08 Oct 2026, 02:26 PM

Hello Yoan,

First of all, thank you for the reply.

This issue is truly important for us to be able to finalize our project!
It is crucial that we get a solution or update as soon as possible, because it directly impacts the time and cost commitments that we have already made with the client!!

Thanks, Alexandre

Yoan
Telerik team
commented on 12 Oct 2026, 11:04 AM

Hello Alexandre,

We completely understand the urgency of the matter and want to assure you that the issue has already been escalated to our Engineering team and is currently under active development. The team is aware of the business impact you've described and is working to validate and address the issue as part of the ongoing development effort.

At this stage, our current intention is to include the improvement in the next Document Processing release, provided development and validation proceed as planned.

Thank you for your patience and understanding while we work through this.

Regards,

Yoan

Tags
Documentation
Asked by
Alexandre
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or