Skip to main content
All docs
V25.1
  • PdfViewerControl.ShowPrintPageSetupDialog() Method

    Opens the Page Setup dialog.

    Namespace: DevExpress.Xpf.PdfViewer

    Assembly: DevExpress.Xpf.PdfViewer.v25.1.dll

    NuGet Package: DevExpress.Wpf.PdfViewer

    Declaration

    public PdfPrinterSettings ShowPrintPageSetupDialog()

    Returns

    Type Description
    PdfPrinterSettings

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

    Exceptions

    Type Description
    InvalidOperationException

    Occurs if the ShowPrintPageSetupDialog method is called before any window is displayed.

    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:

    using System.Windows;
    using DevExpress.Pdf;
    using DevExpress.Xpf.PdfViewer;
    
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        PdfViewerControl pdfViewer = new PdfViewerControl();
        pdfViewer.AsyncDocumentLoad = false;
        pdfViewer.OpenDocument("Demo.pdf");
    
        PdfPrinterSettings printerSettings = pdfViewer.ShowPrintPageSetupDialog();
        if (printerSettings != null)
        {
            // add your code here
        }
    }
    
    See Also