XRPdfSignature Class
Adds a visual signature to a report exported to PDF.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v26.1.dll
Declaration
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:

Tip
For more information on how to create, export, and sign a report, refer to the following tutorial: Create a Report with a Visual PDF Signature in the Visual Studio Report Designer.
Add a Signature Control to a Report
Drop the XRPdfSignature control from the Toolbox onto a report.

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.

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.
-
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.

Hide
The control does not show a signature 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.

-
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 the Show Captions property to exclude captions from the fields listed above.
| Show Captions Enabled | Show Captions Disabled |
|---|---|
![]() |
![]() |
Add an Accessible Description
You can specify an accessible description for a digital signature to improve exported PDF document accessibility. The description is added when the document is PDF/UA-compatible (PdfExportOptions.PdfUACompatibility is set to PdfUA1 or PdfUA2).
The way you specify an accessible description depends on how you use a XRPdfSignature control. If the control displays the document signature (SignatureOptions.DisplayDocumentSignature is true), use the
PdfSignatureOptions.AccessibleDescription property.

If the XRPdfSignature control is used as a signature placeholder (SignatureOptions.DisplayDocumentSignature is false), you can specify a description with the XRControl.AccessibleDescription property.

The following image displays the result:
- The first
XRPdfSignaturecontrol displays the document signature and usesPdfSignatureOptions.AccessibleDescription. - The second
XRPdfSignaturecontrol does not display the document signature and usesXRControl.AccessibleDescription.

When AccessibleDescription is not specified and the document is exported as an accessible PDF, default accessibility text is used (“Digital signature” or “Digital signature placeholder”). Regular PDF export does not include an accessibility description.
Limitation
- The XRPdfSignature control is not exported to non-PDF formats. A placeholder is added to exported documents instead.
- In .NET Framework projects that reference DevExpress assemblies directly, install the BouncyCastle.Cryptography NuGet package to export a report to PDF with a digital signature.
Display a Signature at Runtime
The following code sample creates a report with an XRPdfSignature control. The control displays document signature information when a report is exported to PDF.
// 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(@"Data\AndrewFuller.pfx", "AndrewFullerPassword");
signatureOptions.Certificate = certificate;
signatureOptions.ImageSource = ImageSource.FromFile(@"Images\signature.png");
signatureOptions.Reason = "Approved";
signatureOptions.Location = "USA";
signatureOptions.ContactInfo = "andrew.fuller@example.com";
report.ExportToPdf("ReportWithSignature.pdf");
Sign the Document on the Web
To sign the exported PDF document in the Web Document Viewer, use one of the following options:
- Sign the document in the Web Document Viewer’s UI
- Implement the IPdfSignatureOptionsProviderAsync interface to register available signature options. Select a signature from the Signature drop-down list in the Export to PDF section.
- Customize the exported document
- Override the CustomizeExportDocumentOnFinish method to retrieve and sign the exported document.
The following example shows how to sign a document exported to PDF:

