All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfSignatureBuilder(IExternalSigner, String) Constructor

Initializes a new instance of the PdfSignatureBuilder class with specified settings.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v21.1.Core.dll

Declaration

public PdfSignatureBuilder(
    IExternalSigner signer,
    string formFieldName
)

Parameters

Name Type Description
signer IExternalSigner

An object used to generate a signature.

formFieldName String

The name of the signature form field to sign.

Exceptions

Type Description
TspValidationException

Occurs if the field with the specified name does not exist.

Remarks

Use this class constructor to sign an existing form field.

Use the Pkcs7Signer class to generate the PKCS#7 signature. Create the Pkcs7SignerBase class descendant to use a custom object to generate the PKCS#7 signature.

//Load a document to be signed:
using (var signer = new PdfDocumentSigner("Document.pdf"))
{
    //Create a PKCS#7 signature:
    Pkcs7Signer pkcs7Signature = new Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256);

    //Apply a signature to the 'Sign' form field:
    var signatureBuilder = new PdfSignatureBuilder(pkcs7Signature, "Sign");

    //Specify the signature's image and signer information:
    signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("Signing Documents//Jane Cooper.jpg"));
    signatureBuilder.Location = "USA";
    signatureBuilder.Name = "Jane Cooper";
    signatureBuilder.Reason = "I Agree";

    //Sign and save the document:
    signer.SaveDocument("SignedDocument.pdf", signatureBuilder);
}
See Also