All docs
V21.1
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+

IExternalSigner Interface

Exposes the basic functionality to generate signatures.

Namespace: DevExpress.Pdf

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

Declaration

public interface IExternalSigner

Remarks

The Pkcs7Signer and PdfTimeStamp classes are default IExternalSigner implementations. Use these classes to generate signatures or create an implementation.

Pass the IExternalSigner implementation object to the PdfSignatureBuilder instance constructor to apply the signature to the signature field, as shown below:

using (var signer = new PdfDocumentSigner("Document.pdf"))
{
    //Create a timestamp:
    ITsaClient tsaClient = new PdfTsaClient(new Uri(@"https://freetsa.org/tsr"), HashAlgorithmType.SHA256);

    //Create a PKCS#7 PAdES signature:
    Pkcs7Signer pkcs7Signature = new Pkcs7Signer("Signing Documents/certificate.pfx", "123", HashAlgorithmType.SHA256, tsaClient, null, null, PdfSignatureProfile.PAdES_BES);

    //Apply the signature to an existing form field:
    var santuzzaSignature = new PdfSignatureBuilder(pkcs7Signature, "Sign");

    //Specify an image and signer information:
    santuzzaSignature.SetImageData(System.IO.File.ReadAllBytes("Signing Documents/SantuzzaValentina.jpg"));
    santuzzaSignature.Location = "Australia";
    santuzzaSignature.Name = "Santuzza Valentina";
    santuzzaSignature.Reason = "I Agree";
    santuzzaSignature.CertificationLevel = PdfCertificationLevel.FillFormsAndAnnotate;

    //Create a new signature form field:
    var signatureFieldInfo1 = new PdfSignatureFieldInfo(1);
    signatureFieldInfo1.Name = "SignatureField1";
    signatureFieldInfo1.SignatureBounds = new PdfRectangle(200, 200, 250, 250);

    //Create a document-level timestamp:
    PdfTimeStamp pdfTimeStamp = new PdfTimeStamp(tsaClient);

    //Apply this timestamp to the form field:
    var timeStampSignature = new PdfSignatureBuilder(pdfTimeStamp, signatureFieldInfo1);

    //Add signatures to an array:
    PdfSignatureBuilder[] signatures = { santuzzaSignature, timeStampSignature };

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