Back to Devexpress

PdfViewer.ShowPrintPageSetupDialog() Method

windowsforms-devexpress-dot-xtrapdfviewer-dot-pdfviewer-59f40829.md

latest2.3 KB
Original Source

PdfViewer.ShowPrintPageSetupDialog() Method

Opens the Page Setup dialog.

Namespace : DevExpress.XtraPdfViewer

Assembly : DevExpress.XtraPdfViewer.v25.2.dll

NuGet Package : DevExpress.Win.PdfViewer

Declaration

csharp
public PdfPrinterSettings ShowPrintPageSetupDialog()
vb
Public Function ShowPrintPageSetupDialog As PdfPrinterSettings

Returns

TypeDescription
PdfPrinterSettings

An object that contains printer settings selected in the Page Setup dialog.

|

Exceptions

TypeDescription
InvalidOperationException

Occurs if no document is loaded to the PdfViewer instance.

|

Remarks

If a user clicks Cancel or closed the Page Setup dialog, the ShowPrintPageSetupDialog method returns null.

The code sample below shows how to obtain printer settings selected in the Page Setup dialog:

csharp
using DevExpress.Pdf;
using DevExpress.XtraPdfViewer;
//...
PdfViewerControl control = new PdfViewerControl();
control.AsyncDocumentLoad = false;
control.OpenDocument(path);
PdfPrinterSettings printerSettings = control.ShowPrintPageSetupDialog();

if (printerSettings != null)
{
       //add your code here
}
vb
Imports DevExpress.Pdf
Imports DevExpress.XtraPdfViewer
'...
Dim control As New PdfViewerControl()
control.AsyncDocumentLoad = False
control.OpenDocument(path)
Dim printerSettings As PdfPrinterSettings = control.ShowPrintPageSetupDialog()
If printerSettings IsNot Nothing Then
     'add your code here
End If

See Also

PdfViewer Class

PdfViewer Members

DevExpress.XtraPdfViewer Namespace