Back to Devexpress

PdfSignatureBuilder.SetSignatureAppearance(PdfSignatureAppearance) Method

officefileapi-devexpress-dot-pdf-dot-pdfsignaturebuilder-dot-setsignatureappearance-x28-devexpress-dot-pdf-dot-pdfsignatureappearance-x29.md

latest4.8 KB
Original Source

PdfSignatureBuilder.SetSignatureAppearance(PdfSignatureAppearance) Method

Sets the signature appearance.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public void SetSignatureAppearance(
    PdfSignatureAppearance appearance
)
vb
Public Sub SetSignatureAppearance(
    appearance As PdfSignatureAppearance
)

Parameters

NameTypeDescription
appearancePdfSignatureAppearance

An object that contains appearance settings.

|

Remarks

Personalized signature appearance allows you to display additional information about the signer, affiliations, or company.

The appearance consists of two components:

  • Signature – a graphic that identifies the signer on the left side of the signature (a photo, scanned signatures and so on).

  • Signature details – data that appears in the right part of the signature.

The PdfSignatureAppearance class properties allow you to customize the signature appearance. Call the SetImageData method to specify an image displayed on the left side. If no image is specified, the signer 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 SetSignatureAppearance method and pass the PdfSignatureAppearance object as a parameter to apply changes to the signature. The SetSignatureAppearance method call discards an image set by the PdfSignatureBuilder.SetImageData() method.

Example

The code sample below customizes the signature appearance:

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

// Specify an image and signer information
santuzzaSignature.Location = "Australia";
santuzzaSignature.Name = "Santuzza Valentina";
santuzzaSignature.Reason = "I Agree";

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

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

// Specify what 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:
santuzzaSignature.SetSignatureAppearance(signatureAppearance);
vb
' Apply a signature to an existing form field
Dim santuzzaSignature = New PdfSignatureBuilder(pkcs7Signature, "Sign")

' Specify an image and signer information
santuzzaSignature.Location = "Australia"
santuzzaSignature.Name = "Santuzza Valentina"
santuzzaSignature.Reason = "I Agree"

' Specify signature appearance parameters:
Dim signatureAppearance As New PdfSignatureAppearance()

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

' Specify what 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:
santuzzaSignature.SetSignatureAppearance(signatureAppearance)

See Also

PdfSignatureBuilder Class

PdfSignatureBuilder Members

DevExpress.Pdf Namespace