isSignedInitially is not a function

I am not get use this code in react for getting digital signature info. PDF.js Express Signature Field | Documentation

image

Thanks
Ravi

Hi Ravi,

Could you please provide more context for this issue? Including a code snippet of the function call would be very helpful.

What version of PDFjs Express are you seeing this error on?

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.

Hi Zach,

I am trying to know if the pdf file is already digitally signed.

WebViewer(...)
  .then(instance => {
    const { documentViewer, annotationManager } = instance.Core;

    documentViewer.addEventListener('annotationsLoaded', () => {
      const signatureWidgetAnnots = annotationManager.getAnnotationsList().filter(
        annot => annot instanceof Annotations.SignatureWidgetAnnotation
      );

    signatureWidgetAnnots.forEach((annot) => {
      annot.isSignedInitially().then((isSigned) => {
        if (isSigned) {
          // if this signature field is signed initially
        } else {
          // if this signature field is not signed initially
        }
      });
    });
  });
})

This is the code snippet

PDFjs version : “@pdftron/pdfjs-express”: “^8.4.0”

Thanks
Ravi

Hi Ravi,

The function isSignedInitially should be isSignedDigitally since you are using 8.4. Migrating to PDF.js Express 8.0 | Documentation

It seems like that documentation is out of date. We are constantly looking for feedback and errors in our documentation so thank you for bringing this to our attention.

I just tested it myself and isSignedDigitally works.

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.

1 Like

Hi Zach

I am trying to use isSignedDigitally function to know the if the pdf file is already signed or not but it is not recognizing the digital signature on pdf file. I have opened the same file in Adobe Acrobat Reader , there it is showing the valid digital signature on the file.

I am attaching the digitally signed file.
NBA Return Slip_esigner (33).pdf (150.8 KB)

Can you please in this.

Thanks
Ravi Basil

Hi Ravi,

So PDFjs Express doesn’t handle flattened annotations.

What I can recommend is to use the REST APIs to extract the signature annotations.
https://pdfjs.express/api/utils/ExpressUtils.html#extract

Here is some documentation on pricing and how to get started.

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.