Printing
- 2 minutes to read
This document describes how to print a document and customize print settings.
You can print the current document using the Print dialog. To invoke the Print dialog, use one of the following options:
click the Print command located on the File toolbar button group;
press Ctrl+P;
or…
right-click the document area and select the Print item in the context menu.
To invoke the Print dialog in code, do one of the following:
call the PdfViewerControl.Print overload method that takes no parameters;
or
- invoke the PdfViewerControl.PrintDocumentCommand command.
In the invoked Print dialog, you can choose the printer and specify the following printing parameters.
Page range selection can include a set of pages such as 2-5, which would include page 2 through to page 5, you can also stipulate the order of pages, so 2-5,1,6 would print pages 2-5, then page 1 followed by page 6.
You can also choose the desired option: fit to page, actual size or custom page scaling.
Page orientation can be specified as portrait or landscape. Alternatively, you can tell the printing system to auto calculate the orientation. If the scaling option is set to “fit to page” and orientation is set to “auto”, the print engine will attempt to set the orientation and scaling to maximize most of the available paper size.
To print a document, click the Print button in the Print dialog.
To print a document without invoking the Print dialog in code, call the corresponding overload of the PdfViewerControl.Print method and pass the printer settings (represented by the PdfPrinterSettings object), and showPrintStatus (defines whether to show or hide the print status dialog) parameters to this method as arguments. See the How to: Use the PDF Printer Settings example for more details.