Skip to main content

PdfExportOptions.SignatureOptions Property

Provides access to digital signature options of PdfExportOptions.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v25.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

[Browsable(false)]
public PdfSignatureOptions SignatureOptions { get; }

Property Value

Type Description
PdfSignatureOptions

A PdfSignatureOptions object.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to SignatureOptions
Cross-Platform Class Library ExportOptions
.Pdf .SignatureOptions
WinForms Controls DiagramOptionsExport
.PdfExportOptions .SignatureOptions
WPF Controls DiagramControl
.PdfExportOptions .SignatureOptions

Remarks

The following example applies a digital signature when a report is exported to PDF.

 Visualize Digital Signature - Export to PDF, DevExpress Reports

void Export() {
    // Create a report.
    XtraReport1 report = new XtraReport1();

    // Create a new X509Certificate2 object.
    X509Certificate2 certificate = new X509Certificate2();

    // Initialize and configure a local certificate storage.
    X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
    store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);

    // Initialize a certificate collection.
    X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
    X509Certificate2Collection fcollection =
        (X509Certificate2Collection)collection.Find(X509FindType.FindByTimeValid, DateTime.Now, true);
    X509Certificate2Collection scollection =
        X509Certificate2UI.SelectFromCollection(fcollection, "Select a Certificate",
            "Select a certificate to view its details.",
            X509SelectionFlag.SingleSelection);
    if (scollection.Count > 0)
        certificate = scollection[0];

    // Specify PDF signature options.
    report.ExportOptions.Pdf.SignatureOptions.Reason = "Approved";
    report.ExportOptions.Pdf.SignatureOptions.Location = "USA";
    report.ExportOptions.Pdf.SignatureOptions.Certificate = certificate;
    // svgImageCollection stores SVG images.
    // In this example, it was created and populated at design time.
    report.ExportOptions.Pdf.SignatureOptions.ImageSource = new ImageSource(svgImageCollection1["approved"]);

    // Export the report to PDF.
    report.ExportToPdf("test.pdf");

    System.Diagnostics.Process.Start("test.pdf");
}

View Example: Apply a Digital Signature

See Also