Getting error while apply digital certificate with multi users

WebViewer Version: 10.11.0

I am getting error when applying multi signature on a document as old signatures got corrupted when applying new signature. If I apply only one signature then It’s working fine but If user B open same file again and apply signature then previous user’s signature got corrupted .
please find the corrupted signature image below :-

This is the code which I am using to apply multi signature:-

                const foundApprovalField1 = await doc.getField(signFieldName[i]);
                const approvalSigField = await PDFNet.DigitalSignatureField.createFromField(foundApprovalField1);
                await approvalSigField.setDocumentPermissions(PDFNet.DigitalSignatureField.DocumentPermissions.e_annotating_formfilling_signing_allowed);
            
                await approvalSigField.signOnNextSaveFromURL(filePath, password);
                if (certificateLocation !== null && certificateLocation !== undefined && certificateLocation !=='')
                    await approvalSigField.setLocation(certificateLocation);                    
                if (certificateReason !== null && certificateReason !== undefined && certificateReason !== '')
                    await approvalSigField.setReason(certificateReason);

                await approvalSigField.setContactInfo(contactInfo);
                VerificationOptions.addTrustedCertificates([filepath]);

               const wewe = await doc.saveMemoryBuffer(PDFNet.SDFDoc.SaveOptions.e_incremental);

Please let me know what I am missing ?

Hi there,

It looks like your use-case involves writing multiple digital signatures in one document. Normally this isn’t allowed but you can enable it via our APIs. Please see this guide for more details:

You can see the available permissions with the digital signature field in our API documentation:
https://docs.apryse.com/api/web/Core.PDFNet.DigitalSignatureField.html#toc3__anchor

Best regards,
Kevin Kim

Hi,

Thanks for the reply.

I have go through the links which you have provided but did not get any info related to my issue. I have already implemented as per your documentation. I have shared my code as well.

The issue which I am facing when I applied multiple signature with diff user on same document then Old signature got corrupted. I have attached the corrupted signature images as well.

May be there is some issue with the permission for old signature certificate as ‘No permission status report’ is showing in the Signature panel for old signature as you can see in the above image.

Note : If I am applied one signature then It’s working fine.

Please suggest me what should I do to resolve this issue.

Hi there,

The issue which I am facing when I applied multiple signature with diff user on same document then Old signature got corrupted. I have attached the corrupted signature images as well.

The API signOnNextSaveFromUrl -
https://docs.apryse.com/api/web/Core.PDFNet.DigitalSignatureField.html#signOnNextSaveFromURL

will throw an error if the signature field already ha a digital signature dictionary. Can you confirm if you are attempting to sign on a different signature field for the second signature?

May be there is some issue with the permission for old signature certificate as ‘No permission status report’ is showing in the status panel for old signature as you can see in the above image. Note : If I am applied one signature then It’s working fine.

When you applied only the initial signature, is the certificate also valid? i.e. something like this:

Please note that setDocumentPermissions API will also need to be applied only on unsigned signatures:
https://docs.apryse.com/api/web/Core.PDFNet.DigitalSignatureField.html#setDocumentPermissions

Best regards,
Kevin Kim

Yes I have applied document permission for unsigned signatures only.

Yes …I am creating diff signature field for each signature like if 2 sign then 2 diff signature fields.

Yes…it’s working fine for initial signature as you can see in below image

Thank you for the clarification,

I believe if you want to sign multiple signatures that this needs to be done sequentially while separated by an incremental save.

await doc.save(filePath, PDFNet.SDFDoc.SaveOptions.e_incremental);

Here is a forum post about signing multiple signatures using our Apryse SDK: Multiple Custom Digital Signature

See this guide for more information:

Best regards,
Kevin Kim