Skip to main content
All docs
V26.1
  • Create a Report with a Visual PDF Signature in the Visual Studio Report Designer

    • 3 minutes to read

    This tutorial describes how to create a report with a visual PDF signature.

    Signed PDF report with visual signature

    Tip

    To get started with this tutorial, create a new project or open an existing project, then add a new blank report to the project.

    Create a Report Layout

    1. Drop the XRRichText control from the DX.26.1: Report Controls Toolbox tab onto the Detail band.

      XRRichText control dropped onto Detail band

    2. Double-click the control and insert text of the DevExpress Website Terms of Use.

      XRRichText editor with terms of use text

    3. Right-click the design surface. Select Insert Band / ReportFooter from the context menu. Enable the footer band‘s PrintAtBottom property.

      Insert ReportFooter band from context menu

    4. Drop the XRPdfSignature control from the DX.26.1: Report Controls Toolbox tab onto the Report Footer band.

      XRPdfSignature control in Report Footer band

    5. Place the XRLabel control to the left of the XRPdfSignature and add the following text: I have read and accept this Website Terms of Use statement.

      XRLabel text placed next to signature field

    Click the Preview tab to see the result.

    Report preview before applying signature

    Export and Sign the Report

    1. In Preview, click Export Document and select PDF File.

      Preview export menu with PDF option

    2. In the invoked PDF Export Options dialog, click the Digital Signature option’s ellipsis button.

      PDF Export Options digital signature settings

    3. In the invoked Signature Options dialog, choose a certificate and specify signature details.

      Signature Options dialog with certificate selection

    Save and open the document to see the final result.

    Final exported PDF with signature fields

    Tip

    All signature fields are displayed in the exported document. You can also hide unnecessary fields. See the XRPdfSignature control’s description for details on how to configure the fields.

    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:

    View Example: How to Sign the Exported PDF Document

    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.

    PDF signature description setting

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

    Signature placeholder description field

    The following image displays the result:

    • The first XRPdfSignature control displays the document signature and uses PdfSignatureOptions.AccessibleDescription.
    • The second XRPdfSignature control does not display the document signature and uses XRControl.AccessibleDescription.

    Tag tree signature descriptions

    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.

    PDF Signature Control 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.

    Create a Report with a Visual PDF Signature in the End-User Report Designer

    Tutorials that explain how to create different reports in EUD Report Designers for WinForms and Web are included in the End-User Documentation online help section: