About Signing the document via multiple users

We are using WebViewer Version: 8.11.0 in an existing React application.
Our requirement: we are having multiple signers one after other. Assume 4 people need to sign in a synchronous manner. Person1 signed and then transferred to Person2. Now, Person2 should be able to sign himself and shouldn’t be able to edit Person1 but can view Person1’s sign.

Is there a way to perform the same? Kindly, guide us to proceed further.

Sugandha Inani


Thank you for contacting WebViewer Support.

We don’t have the functionality to bind a specific field to a user. However, we have a solution that can help you to achieve this.
Below is a code snippet with this solution and right after is the explanation of what I’m doing on it.

Webviewer({}, document.getElementById('viewer')).then(instance => {
  const { Annotations, annotationManager } = instance;

   const currentUser = annotationManager.getCurrentUser();
   annotationManager.addEventListener('annotationChanged', (annotations, action, { imported }) => {       
      if (action === 'add') {      
         annotations.forEach((annot) => {        
            if (annot instanceof Annotations.SignatureWidgetAnnotation) {
               // if the annotation change occurs because of an import then    
               // these are fields from inside the document          
               if(imported) {
                  const customData = annot.getCustomData('user');
                  if (customData && customData !== currentUser) {
                     annot.fieldFlags.set('ReadOnly', true);
               // Setting a custom data when adding a signature annotation
               } else if(!imported && action === 'add') {
                  annot.setCustomData('user', currentUser);

So, here I’m checking these two cases when adding annotations:

  1. When adding form fields, I’m setting custom data on the widget to specify which user is allowed to sign it (in this case the current user will be the one that can sign this field and you can edit the way you want).
  2. When opening a document, during the annotation loading event, I check if the logged-in user matches the user that is allowed to sign the widget. If the user does not match, I’m setting the field as readOnly.

You can test this by creating signature fields with a user, downloading the file and then opening the file with another user. You’ll see that the second user cannot sign on those signature fields. Please let me know if this helps you.

Dandara Navarro
Web Software Developer
PDFTron Systems, Inc.