Add Annotations without breaking the existing signature

Product:
Webviewer
Product Version:
10.9.0
Please give a brief summary of your issue:
The starting point is a signed PDF which allows annotations to be added later.
If you now add annotations to this PDF using the standard PDF desktop viewers, the signature will continue to be displayed as valid. We have now tried this with the WebViewer, but it seems to break the signature in our case.
Now the question is whether there is a way to annotate the document with the web viewer without breaking the signature.

When comparing the documents, it is noticeable that the other editors only made changes at the end of the document. In the web viewer, changes were made in several places.

Please describe your issue and provide steps to reproduce it:

  • Open signed document
  • Add stamp annotation
  • Save
  • Check signature of the saved document

Please provide a link to a minimal sample where the issue is reproducible:

I tried flags instance.Core.SaveOptions.LINEARIZED and instance.Core.SaveOptions.INCREMENTAL.

const data = await doc?.getFileData({ xfdfString, flags });
let arr = new Uint8Array(data);
const blob = new Blob([arr], { type: 'application/pdf' });
1 Like

Hi there,

Thank you for reaching out to WebViewer forums,

Digital signatures in WebViewer has permissions that you can set with the following options:
https://docs.apryse.com/api/web/Core.PDFNet.DigitalSignatureField.html#setDocumentPermissions

e_no_changes_allowed : 1
e_formfilling_signing_allowed : 2
e_annotating_formfilling_signing_allowed : 3
e_unrestricted : 4

Best regards,
Kevin Kim

1 Like

Hi Kevin,

thanks for your answer. In our case, we want to annotate an already signed document (from an external system) without breaking the existing signature. The signature is defined as you write it in your description. In other common PDF Editors, the existing PDF signature will be respected.

Or do these parameters also prevent that the Webviewer modifies the content and breaks the signature?

Best regards
Uli

1 Like

Hi there,

You can set the above permissions of the signature fields so that WebViewer will not ‘break’ the signature when making edits.
When loading the already signed document on WebViewer, you can use getDocumentPermissions API to see what the permission is when loaded. Then you can modify the permissions if it is not set to allow edits.

Best regards,
Kevin Kim

1 Like

Hi Kevin,

thanks for the tip. I set instance.Core.annotationManager.disableReadOnlyMode(); and test it again. Now the existing signature is not broken after i add some annotations.

I use the instance.Core.documentViewer.getDocument().getPDFDoc().getDigitalSignaturePermissions() to check the defined restrictions.

Thank you very much for your support.
Best regards
Uli

1 Like