Trusted by the world’s leading companies
Overview
The Syncfusion JavaScript PDF Library provides a simple and efficient solution for adding digital signatures to PDF files directly from web applications. It supports standard certificate‑based signing using X.509 certificates, including .pfx files with private keys, enabling developers to secure PDF documents. These options help ensure the authenticity and integrity of documents within client‑side or server‑side JavaScript environments.
The library allows you to apply both visible and invisible digital signatures, customize signature appearances, and add multiple signatures to a single PDF.
These signature feature works seamlessly across modern development platforms and frameworks, including JavaScript, TypeScript, Angular, React, Vue, ASP.NET Core, Node.js, and other web‑based applications.
How to digitally sign PDFs using JavaScript?
import {PdfDocument, PdfPage, PdfForm, PdfSignatureField, DigestAlgorithm, CryptographicStandard} from '@syncfusion/ej2-pdf';
// Load the document
let document: PdfDocument = new PdfDocument()
// Get the first page of the document
let page: PdfPage = document.addPage();
// Access the PDF form
let form: PdfForm = document.form;
// Create a new signature field
let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
x: 10,
y: 10,
width: 100,
height: 50
});
// Create a new signature using PFX data and private key
let sign: PdfSignature = PdfSignature.create(
{
cryptographicStandard: CryptographicStandard.cms,
digestAlgorithm: DigestAlgorithm.sha256
},
certData,
password
);
// Set the signature to the field
field.setSignature(sign);
// Add the field into PDF form
form.add(field);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();Key functions of the PDF digital signature feature
Explore different key functionalities of the digital signature feature.
Custom appearance
Customizing the appearance of digital signatures on a PDF page is straightforward for users. The customization options encompass diverse elements like images, text, and shapes.
CAdES and different hashing algorithms
The default digital signatures generated by the Syncfusion JavaScript PDF Library follow the CMS standard and use SHA 256 hashing algorithms. Users have the option to switch to the CAdES standard and utilize various hashing algorithms for their digital signatures.
Multiple signatures
Multiple digital signatures can be added to a single PDF document by appending additional signatures to an already-signed document.
Author or certify signatures
An author signature or certified signature provides a higher level of document control than a normal signature over actions like form filling, comments, and digital signing. This is usually implemented by the creator of the document before it is published or sent for additional signatures.
External signatures
Sign PDF documents with an external digital signature created from various sources, such as an HSM, USB tokens, smart cards, or other cloud services.
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
Frequently Asked Questions
What is a digital signature in a PDF?
A digital signature in a PDF is a way to ensure the integrity and authenticity of the document. It involves using cryptographic techniques to create a unique identifier for the document that can be verified by others.
Does the library support external signing (HSM/remote signing)?
Yes, you can hash the PDF externally, sign it with your service or HSM, and embed the signature value back.
Can I customize the appearance of a visible signature?
Yes, you can configure text, fonts, bounds, and optional signature images or stamps.
Can I lock fields after signing?
Yes, you can lock specific form fields or the entire document when the signature is applied.
What is the process involved in adding a digital signature to a PDF?
The process involves generating a cryptographic key pair, signing the PDF document using the private key, and then embedding the signature into the PDF file. You would also need to ensure that the necessary certificate is available for signing.
Can a PDF have multiple signatures?
Yes, each signature adds an incremental revision, preserving previous signed versions.
Can I access previous revisions created by signatures?
Yes, you can retrieve all revisions or get the specific revision linked to an individual signature.
Can I retrieve signature and certificate details from a loaded PDF?
Yes, after opening the document, you can access each signature field and read signer info, certificate metadata, and signature properties.
Our Customers Love Us
Awards
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.