Signature Plugin

Overview

The Aspose.Pdf.LowCode.Signature plugin applies a digital signature to a PDF document. Configure the operation with SignOptions, provide a PFX certificate file or stream, add input and output data sources, and call Process.

Sign a PDF document

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void SignPdfWithPlugin()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_SecuritySignatures();

    // Create PDF Signature plugin
    var plugin = new Aspose.Pdf.LowCode.Signature();

    // Configure signature options
    var options = new Aspose.Pdf.LowCode.SignOptions(dataDir + "rsa_cert.pfx", "12345");
    options.Reason = "Document approval";
    options.Contact = "contact@example.com";
    options.Location = "Office";
    options.AddInput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "DigitallySign.pdf"));
    options.AddOutput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "SignPdfWithPlugin_out.pdf"));

    // Sign the file
    var result = plugin.Process(options);

    // Get the path of the signed PDF document
    var outputPath = result.ResultCollection[0].ToFile();
}

Options

SignOptions includes public properties such as PageNumber, Visible, Rectangle, Reason, Contact, Location, and Name.