Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

PdfDocumentSigner Class

A helper class used to apply signatures to PDF documents.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v20.2.dll

Declaration

public class PdfDocumentSigner :
    IDisposable

Remarks

Use the PdfDocumentSigner instance to apply signatures to new or existing signature fields. Call the PdfDocumentSigner.SaveDocument method to sign and save the PDF document.

The PdfSignatureBuilder class represents signatures. The PDF Document API supports PKCS#7 signatures. You can use the Pkcs7Signer class to provide PKCS#7 signatures. Create a Pkcs7SignerBase descendant to use a custom object to create the PKCS#7 signature.

The code sample below shows how to sign an existing signature field:

using DevExpress.Pdf;
using DevExpress.Office.DigitalSignatures;
using DevExpress.Office.Tsp;

using (var signer = new PdfDocumentSigner("Document.pdf"))
{
    ITsaClient tsaClient = new TsaClient(new Uri(@"http://timestamp.apple.com/ts01"), HashAlgorithmType.SHA256);
    var signatureBuilder = new PdfSignatureBuilder(new Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256, tsaClient),
            "Sign");
    signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("Signing Documents//Jane Cooper.jpg"));
    signatureBuilder.Location = "USA";

    signer.SaveDocument("out2.pdf", signatureBuilder);
}

Inheritance

Object
PdfDocumentSigner
See Also