For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sign PDFs and manage signing workflows using JavaScript

For more advanced controls - including document permissions, custom signing for HSM integration, and LTV/time stamping - please refer to the sample below: Digitally sign PDF files

Requirements

The following packages are required to use these features in production. Trial keys have unlimited access to all features.

Package: Digital SignatureLive demo

WebViewer provides APIs to create smooth signing workflows. You can easily create fields, assign users to specific fields, and help them navigate the form and sign it. These APIs are flexible, so you can create customized signing apps for your needs.

A flowchart diagram displaying 4 steps. Step 1 is "Create: Create your form" and shows a document with 6 gray fields. Step 2 is "Assign: Assign any field to any user" and shows the same document with the odd fields blue and assigned to John, while the even fields are orange and assigned to Mary. Step 3 is "Jump: Navigate between fields, e.g. for each user" and shows the same document with a line drawn between field 1 and 3. Step 4 is "Sign: Fill and sign fields" which shows the document with all of John's fields signed by John.
A potential use case of the WebViewer signing APIs

The fields in these workflows can hold e-signatures or digital signatures. For the difference between them, and how certificates and certificate authorities work, see Digital signature vs. e-signature.

Assign fields to users

By default, anyone can sign any field. In practice, you often need to limit fields to specific users. You can use Field.setUser(id) and FieldManager.getFieldsForUser(id) APIs to assign a user to a field and get a list of fields for a user. You can then update field permissions to allow only that user to sign it.

Info: The Field.setUser, Field.getUser, and FieldManager.getFieldsForUser APIs were added in WebViewer v12.1.0.

Jump to a field

To make the viewer jump to a specific field, you can use the FieldManager.jumpToField API. The API accepts options to adjust how the viewer will jump. This feature can be leveraged to automatically scroll a user between fields in a signing workflow. See Digital signature samples using JavaScript.

Related links

Digitally sign a field

To sign an existing approval signature field in a PDF document:

Info

The signed PDF is in the buffer returned by the signing call. Save or download this buffer, as shown in the previous code sample. The document opened in the viewer is not the signed file. Downloading the document from the viewer, for example with the Download button or downloadPdf(), produces a copy whose signatures fail validation.

For more advanced controls - including document permissions, custom signing for HSM integration, and LTV/time stamping - please refer to the sample below: Digitally sign PDF files

About approval signatures

The Apryse SDK enables approval signatures in PDF documents using a Digital Certificate, in accordance with the latest PDF specification.

By leveraging public key infrastructure (PKI) technology, with a certificate issued by a trusted certificate authority (CA), a signer can use a certificate-based digital ID to guarantee a signature's authenticity. A certificate-based digital signature can also ensure that a document has not been modified since the signature was applied, preserving its authenticity.

When you open a signed PDF in WebViewer, the Signatures panel shows the verification result for each signature.

WebViewer's Signatures panel showing two verified signatures, one approval signature and one certification signature from http://www.pdftron.com, both marked valid and trusted.
Verified signatures in WebViewer's Signatures panel.

In this example, the first is an approval signature (Signed) and the second is a certification signature (Certified by…).

Next steps

You can use the APIs above to build a custom document signing app that is quick, easy, and secure. Users can be assigned to specific fields, automatically scroll to the next field, and finalize their changes with confidence in the document's authenticity.

For a sample implementation, see Digital signature samples using JavaScript.

Last updated

Was this helpful?