PDF Document API – Digital Signature Appearance (v21.1)

As you may already know, the DevExpress PDF Document API supports multiple digital signature options. For background information on our implementation, please review the following blog posts:

Our PDF Document API (v21.1) allows you to customize signature appearance options and can now display additional information about the signer, his/her affiliations, or the company itself.

PdfSignatureAppearance class properties allow you to specify a graphic that identifies the signer, signature details data, and background image. Call the SetImageData method to specify an image displayed on the left side of the signature. If no image is specified, the signer’s name is displayed. The name is extracted from the signing certificate or the PdfSignatureBuilder.Name property. Set the AppearanceType property to None to display only signature details.

Call the PdfSignatureBuilder.SetSignatureAppearance method and pass a PdfSignatureAppearance object as a parameter to apply changes to the signature.

The code below demonstrates how to customize signature appearance:

using (var signer = new PdfDocumentSigner("Document.pdf"))

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

  // Specify image and signer information:
  santuzzaSignature.Location = "USA";
  santuzzaSignature.Name = "John Smith";
  santuzzaSignature.Reason = "I Agree";

  // Specify signature appearance parameters:
  PdfSignatureAppearance signatureAppearance = new PdfSignatureAppearance();

  // Add signature image:
  signatureAppearance.SetImageData("Signing Documents/logo.png");

  // Specify the necessary information to display:
  signatureAppearance.ShowDate = true;
  signatureAppearance.ShowLocation = true;

  // Set display format for date and time:
  signatureAppearance.DateTimeFormat = "MM/dd/yyyy";

  // Change font settings for signature details:
  signatureAppearance.SignatureDetailsFont.Size = 12;
  signatureAppearance.SignatureDetailsFont.Italic = true;

  // Apply changes:

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

We also updated our PDF Signature demo module to help you explore these capabilities at your own pace. Please note that installation of the DevExpress Office File API Subscription is required to execute this demo.

Run Demo

Tell Us What You Think

As always, we welcome your feedback. Please feel free to leave comments below or contact us via the DevExpress Support Center.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.