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+

PdfDocumentSigner.ClearSignatureField(String) Method

Removes a signature applied to the specific signature field.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll

Declaration

public void ClearSignatureField(
    string formFieldName
)

Parameters

Name Type Description
formFieldName String

The field name to clear.

Remarks

The PdfDocumentSigner.GetSignatureFieldNames() allows you to retrieve signed form field names.

Use the PdfDocumentSigner.ClearSignatureFields() method to clear all signed form fields.

The code sample below shows how to retrieve signed form field names and apply a new signature to the first field:

using DevExpress.Pdf;
using System.Diagnostics;
using System.IO;
using DevExpress.Office.DigitalSignatures;

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

    // Retrieve all signed form fields:
    var signedFields = signer.GetSignatureFieldNames(false);

    // Clear the first signature field:
    signer.ClearSignatureField(signedFields[0]);

    // Apply a new signature to this form field:
    var santuzzaSignature = new PdfSignatureBuilder(pkcs7Signature, signedFields[0]);

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

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