Digital Signatures
import {PdfDocument} from "@ironsoftware/ironpdf";

(async () => {
    // Step 1. Import a PDF
const pdf = await PdfDocument.open("sample.pdf");

    // Step 2. Sign the PDF with digital certificate
    await pdf.signDigitalSignature({
        certificatePath: "IronSoftware.pfx",
        certificatePassword: "123456",
        signingReason: "To show how to sign a PDF",
        signingLocation: "Chicago, USA",
        signatureImage: {
            SignatureImagePath: "logo.png"
        }
    });

    //Step 3. The PDF is not signed until saved to file.
await pdf.saveAs("signed.pdf");
})();
npm i @ironsoftware/ironpdf
Digital Signatures

Digital Signatures

The process of applying a digital signature to a PDF document begins by importing an existing PDF file.

To apply a digital signature, use the signDigitalSignature method. This method requires specifying the file path to the digital certificate and providing the necessary password for signing the document. Additionally, you can include other information such as the reason for signing and the location.

Here is an example of how to apply a digital signature using IronPDF in C#:

In this example:

  • We start by loading an existing PDF document using PdfDocument.FromFile.
  • We then apply a digital signature using the SignDigitalSignature method, which requires the path to a .pfx file (your digital certificate) and its corresponding password. You can also provide additional details like the reason and location of signing.
  • Finally, the signed PDF is saved using the SaveAs method.

Once the digital signature has been applied, export the signed PDF document using the saveAs method. This version of the document is now securely signed.

For more details on using this method with IronPDF, you can visit IronPDF's digital signature documentation on their website.

Explore Code: Digitally Sign a PDF with IronPDF
View on GitHub

Ready to Get Started?

Version:2026.11just released