Is signing PDFs with existing fields created with Adobe Acrobat possible?

Discussions about PDF management.
Post Reply
sbarlow
Posts: 33
Joined: Fri Jun 19, 2009 3:13 pm

Is signing PDFs with existing fields created with Adobe Acrobat possible?

Post by sbarlow » Tue Jun 15, 2021 6:40 pm

I have been through the digital signing example, and the use of GDViewer.

Using winforms, although I can place a new signature from the certificate store on the Adobe pdf (or any PDF) using GDPicture, I can't for the life of me see a way to fill an existing signature field with a valid signature and have it look like it was signed in Acrobat using GDPicture. If it is possible, a code example would help.

Our use case is to present the user with a PDF in the viewer and have them sign it. One may suggest using Adobe Acrobat, Acrobat DC or other product for this but we need access to the saved PDF after signing in order to continue a process. This is not possible in Adobe without the use of their SDK.

Added note that these are not unique PDFs, they may have a different number of signature fields, whose field names and titles may change. That is why we need the user interaction to sign them, which would be from the viewer.

Hugo
Posts: 101
Joined: Tue Dec 18, 2018 10:09 am

Re: Is signing PDFs with existing fields created with Adobe Acrobat possible?

Post by Hugo » Tue Jul 06, 2021 1:42 pm

Hi there,

Thank you for your question.

Here is a code sample which you should try on your end to successfully do this:

Code: Select all

Using oGdPicturePDF As GdPicturePDF = New GdPicturePDF
            oGdPicturePDF.LoadFromFile("Test Document to sign1.pdf")
            oGdPicturePDF.SetSignatureInfo("Orpalis", "GdPicturePDF", "Toulouse (France)", "")
            Dim fontResName = oGdPicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontCourier)
            oGdPicturePDF.SetSignatureText("Signed by Orpalis test code snippet " + DateTime.Today.ToString("dd-MM-yyyy"), fontResName, 12, Color.Black, TextAlignment.TextAlignmentCenter, TextAlignment.TextAlignmentCenter, True)

            'in our test file there is exactly one placeholder
            oGdPicturePDF.SetSignaturePosFromPlaceHolder(0)

            oGdPicturePDF.SetSignatureCertificateFromP12("test.pfx", "password")
            oGdPicturePDF.ApplySignature("Test Document to sign1_signed.pdf", PdfSignatureMode.PdfSignatureModeAdobeCADES, False)
        End Using
The way to retrieve the signature placeholder by name is here and certain aspects of it can be used to locate the signature, e.g. locate signature under cursor, get the name, use the name as placeholder.
https://guides.gdpicture.com/content/Gd ... ring).html

When it comes to selecting the signatures yourself, how far have you currently gotten on this front?

Let me know if this helps you.

Regards,
Hugo

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest