All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
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.

XRPdfSignature Class

Adds a visual signature to a report exported to PDF.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

Declaration

public class XRPdfSignature :
    XRControl
Public Class XRPdfSignature
    Inherits XRControl

Remarks

You can sign a report document when you export it to PDF. The signature information you specify is saved to the document's PDF Signature Options. The XRPdfSignature control visualizes the document signature information:

XRPdfSignature Overview

TIP

For more information on how to create, export, and sign a report, refer to the following tutorial: Reports with a Visual PDF Signature.

Add a Signature Control to a Report

Drop the XRPdfSignature control from the Toolbox onto a report.

Drop XRPdfSignature from the Toolbox

Report with Multiple Signatures

The first XRPdfSignature control is added to a report with the Display Document Signature property enabled. This control visualizes the document signature information.

Other XRPdfSignature controls are added with the Display Document Signature property disabled. When a report is exported to PDF, these controls are converted to signature form fields. Users can open an exported file in a PDF editor and put their signatures in these fields.

Multiple Controils

Enable a control's Display Document Signature property to make it visualize the document's signature information. This property becomes disabled for all other signature controls.

If all signature controls have the Display Document Signature property disabled, the signature information is added to an exported file but is not displayed.

Specify Signature Options

Expand the control's smart tag and enable check boxes for the signature fields that you want to display.

  • Image Display Mode

    Specifies whether the control shows the signature image. The following property values are available:

    • Show

      The control shows a sample signature image. If an exported document is signed, the converted PDF form field shows the actual signature image.

      Show Certificate Image

    • Hide

      The control does not show a signature image.

      Hide Certificate Image

    • ShowCertificateNameAsImage

      The control shows a sample certificate name in place of a signature image. When an exported document is signed, the converted PDF form field shows the actual certificate name.

      Show Certificate Name as Image

  • Display Document Signature

    Specifies whether the control displays the document signature information. For more information, refer to the following section: Report with Multiple Signatures.

The signature control shows the certificate name, distinguished name, location, signature date, and signature reason. Disable the corresponding options in the control's smart tag to hide these fields.

Disable Signature Options

Disable the Show Captions property to exclude captions from the fields listed above.

Show Captions Enabled Show Captions Disabled
Show Captions Enabled Show Captions Disabled

Limitations

  • The XRPdfContent control is not exported to non-PDF formats. A placeholder is added to exported documents instead.
  • The Web Document Viewer does not allow you to sign an exported document. The XRPdfContent control's Display Document Signature property is not in effect. You can add a signature to an exported file in a PDF editor.

Display a Signature at Runtime

The following code sample demonstrates how to create a report with an XRPdfSignature control and make this control display the document signature information when a report is exported to PDF.

View Example

using System;
using System.Windows.Forms;
using System.Security.Cryptography.X509Certificates;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Drawing;
// ...
// Create a simple report.
XtraReport report = new XtraReport() {
    Bands = {new DetailBand() {
            Controls = {
                new XRPdfSignature() { 
                    SignatureOptions = { 
                        ImageDisplayMode = SignatureImageDisplayMode.Show,
                        ShowCaptions = false,
                        ShowCertificateName = true,
                        ShowDistinguishedName = false,
                        ShowLocation = true,
                        ShowSignatureDate = true,
                        ShowSignatureReason = true
                    }
                }
            }
        }
    }
};

// Specify signature information.
PdfSignatureOptions signatureOptions = report.ExportOptions.Pdf.SignatureOptions;
X509Certificate2 certificate = new X509Certificate2("C:\\Signatures\\AndrewFuller.pfx", "password");
signatureOptions.Certificate = certificate;
signatureOptions.ImageSource = ImageSource.FromFile("C:\\Signatures\\AndrewFuller.png");
signatureOptions.Reason = "Approved";
signatureOptions.Location = "USA";
signatureOptions.ContactInfo = "andrew.fuller@example.com";
report.ExportToPdf("C:\\Reports\\ReportWithSignature.pdf");

Inheritance

See Also