Back to Devexpress

PdfExportOptions.ShowPrintDialogOnOpen Property

corelibraries-devexpress-dot-xtraprinting-dot-pdfexportoptions-ec70a8a2.md

latest3.9 KB
Original Source

PdfExportOptions.ShowPrintDialogOnOpen Property

Gets or sets whether to display the Print dialog when a PDF file is opened.

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[DefaultValue(false)]
public bool ShowPrintDialogOnOpen { get; set; }
vb
<DefaultValue(False)>
Public Property ShowPrintDialogOnOpen As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true , to show the Print dialog on open; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to ShowPrintDialogOnOpen
Cross-Platform Class LibraryExportOptions

.Pdf .ShowPrintDialogOnOpen

| | WinForms Controls | DiagramOptionsExport |

.PdfExportOptions .ShowPrintDialogOnOpen

| | WPF Controls | DiagramControl |

.PdfExportOptions .ShowPrintDialogOnOpen

|

Remarks

Set the ShowPrintDialogOnOpen property to true to display the Print dialog when users open an exported document.

Do not use this option in web applications because most modern browsers disable scripts in PDF.

Note

The Print dialog is not displayed when users open a document in the following web browsers:

  • Google Chrome version 77 or later.
  • Microsoft Edge.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowPrintDialogOnOpen property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-print-a-report-without-displaying-a-preview/CS/InstantPrintReportsV2Example.Web/InstantPrintReport.aspx.cs#L27

csharp
PdfExportOptions options = new PdfExportOptions();
options.ShowPrintDialogOnOpen = true;
report.ExportToPdf(ms, options);

xaf-print-a-report-without-displaying-a-preview/VB/InstantPrintReportsV2Example.Web/InstantPrintReport.aspx.vb#L29

vb
Dim options As New PdfExportOptions()
options.ShowPrintDialogOnOpen = True
report.ExportToPdf(ms, options)

See Also

PdfExportOptions Class

PdfExportOptions Members

DevExpress.XtraPrinting Namespace