.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfDocumentSigner Class

A helper class used to apply signatures to PDF documents.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.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);
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the PdfDocumentSigner class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
PdfDocumentSigner
See Also