Back to Devexpress

PdfExportOptions.SignatureOptions Property

corelibraries-devexpress-dot-xtraprinting-dot-pdfexportoptions-3ff4c8ef.md

latest4.0 KB
Original Source

PdfExportOptions.SignatureOptions Property

Provides access to digital signature options of PdfExportOptions.

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[Browsable(false)]
public PdfSignatureOptions SignatureOptions { get; }
vb
<Browsable(False)>
Public ReadOnly Property SignatureOptions As PdfSignatureOptions

Property Value

TypeDescription
PdfSignatureOptions

A PdfSignatureOptions object.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to SignatureOptions
Cross-Platform Class LibraryExportOptions

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

csharp
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

PdfExportOptions Class

PdfExportOptions Members

DevExpress.XtraPrinting Namespace