Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jul 11, 2024 4:27 pm

Using current version.. Spire PDF 10.6.25

I'm utilizing the Digital Signature functionality.

Code: Select all
PdfSignature signature = new PdfSignature(doc, doc.Pages[int.Parse(coordinates["PageIndex"].ToString())], cert, "signer1_" + "DigitalSignature");


First person signs the signature field and we apply the certificate successfully.

Image

Now I have another user that needs to digitally sign the same document on different signature field, so I load the last signed document into the Spire PDF object and apply a their signature and save. But now shows first signature is bad and signature panel shows bad..

Image


Why? ( Is it the modification now allowed) in the properties is this why? How do I prevent this and have the document signed more then once to reflect different signatures in the panel

motogeek
 
Posts: 15
Joined: Tue Mar 16, 2021 4:18 am

Thu Jul 11, 2024 5:24 pm

I just did a benchmark PDF at AdobeSign and the difference seems to be

My document says “Modification Not Allowed”

And on there Signature Panel meta data says “Only commenting, Form-fill, signing and page adding actions are allowed”

How do I achieve setting the permission to the document for signature to allow these settings.

motogeek
 
Posts: 15
Joined: Tue Mar 16, 2021 4:18 am

Fri Jul 12, 2024 3:34 am

Hi,

Thank you for your inquiry.
Please refer to code below to add multiple digital signatures. If there's still any issue, please provide your PDF document for our further investigation. Thanks in advance!

Code: Select all
            //Create PDF document
            PdfDocument document = new PdfDocument();

            //Load the PDF document
            document.LoadFromFile(@"..\..\..\..\..\..\Data\AddMultipleSignatures.pdf");

            //Create X509Certificate2
            X509Certificate2 x509 = new X509Certificate2(@"..\..\..\..\..\..\Data\gary.pfx", "e-iceblue");

            //Create PdfOrdinarySignatureMaker
            PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(document, x509);

            //Set signature appearance
            PdfSignatureAppearance signatureAppearance = new PdfSignatureAppearance(signatureMaker.Signature);
            signatureAppearance.NameLabel = "Signer:";
            signatureAppearance.ContactInfoLabel = "ContactInfo:";
            signatureAppearance.LocationLabel = "Location:";
            signatureAppearance.ReasonLabel = "Reason:";

            //Set details for the signature1
            PdfSignature signature1 = signatureMaker.Signature;
            signature1.Name = "Tom";
            signature1.ContactInfo = "Tom Tang";
            signature1.Location = "China";
            signature1.Reason = "protect document data";

            //Add the first signature
            signatureMaker.MakeSignature("Signature1", document.Pages[0], 100, 300, 120, 70, signatureAppearance);

            //Set details for the signature2
            PdfSignature signature2 = signatureMaker.Signature;
            signature2.Name = "Bob";
            signature2.ContactInfo = "Bob Li";
            signature2.Location = "China";
            signature2.Reason = "protect document data";

            //Add the second signature
            signatureMaker.MakeSignature("Signature2", document.Pages[0], 400, 300, 120, 70, signatureAppearance);

            //Save the PDF document
            string outpdf = "AddMultipleSignatures_result.pdf";
            document.SaveToFile(outpdf, FileFormat.PDF);


Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 334
Joined: Mon Nov 07, 2022 8:10 am

Sun Jul 14, 2024 12:46 am

Thanks Spire.PDF...

We actually discovered that this is a Spire PDF License issue.

Your free version does not support 2 or more signatures on the document.

When we uploaded the code to our production environment where our paid Spire PDF OEM license is, it worked correctly. I understand why their is a limitation, but not documented anywhere and was very puzzling for us. I actually came across someone in your forum posts with a similar problem and this is when I started tracking down the versions and licenses we were using in development versus production.

But your code helped us discover another way to do signatures.. Thanks for that..

Thought I would reply incase someone has the same issue.

motogeek
 
Posts: 15
Joined: Tue Mar 16, 2021 4:18 am

Mon Jul 15, 2024 9:17 am

Hi,

Thank you for your kind feedback.
I tested the free version of Spire.PDF 10.2.0, and the issue you mentioned did not seem to occur. I tested the signing method you used and was able to successfully add two signatures. I've attached screenshots below for your reference.
However, I'm glad to hear that you've resolved the issue with the official version. If you have any other questions, please feel free to contact us anytime.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 334
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.PDF