Invisible Signing: Digitally Sign Any PDF

With PSPDFKit for Web, it’s possible to digitally sign any document, even when it doesn’t originally include any signature form field.

Try for Free Launch Demo

Our SDK makes it possible through invisible digital signing:

  • A new, invisible signature form field is added to the document you want to sign.

  • PSPDFKit for Web passes you the byte range and a hash representation of the current state of the document.

  • Using your signing service, you can sign either the hash or the byte range, and in turn you’ll obtain a PKCS#7 container.

  • You pass the container back to PSPDFKit for Web to be applied to the new, ad hoc invisible signature form field.

The process involves some domain knowledge about how digital signatures work, so it’s recommended you start by looking at our digital signatures guide.

Invisible Signing in Action

You can also learn how invisible signing works by checking out our public catalog, which includes an example of invisible digital signing. You can digitally sign the provided document and download the resulting signed document.

Actual signing is performed by invoking the instance.signDocument() API method, which works slightly differently in Standalone and Server-Backed operational modes:

instance.signDocument(null, function({ hash, fileContents }) {
  return new Promise(function(resolve, reject) {
	// `getPKCS7Container()` signing helper provided by customer code.
    const PKCS7Container = getPKCS7Container(hash, fileContents);
    if (PKCS7Container != null) {
      return resolve(PKCS7Container)
    }
    reject(new Error("Could not retrieve the PKCS7 container."))
  });
})
  .then(function() {
    console.log("Document signed!");
  });
instance.signDocument(null, { signingToken: "My security token" })
  .then(function() {
    console.log("Document signed!");
  });

The code above uses the CMS signing method. The source code for the example is available for you to clone and play with in our public repository. You’ll also find the rest of our catalog examples there.