RichEditControl.Print(PrinterSettings) Method
Prints the document with the given printer settings.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.XtraRichEdit.v19.1.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
printerSettings | PrinterSettings | A PrinterSettings instance containing printer settings. |
Remarks
Call the Print method to print the target document with the specified options: the number of copies, double-sided printing, etc.
Note
PrinterSettings properties, such as PageSettings.Margins or PageSettings.Landscape (accessed using the PrinterSettings.DefaultPageSettings property), do not affect the layout of a printed document. Change the desired settings of a document section (accessed by the Section.Page property) to modify the document page layout properties before printing.
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-print-from-the-xtrarichedit-t595964
PrinterSettings printerSettings = new PrinterSettings();
//Set the document pages to print:
printerSettings.FromPage = 2;
printerSettings.ToPage = 3;
//Specify the number of copies:
printerSettings.Copies = 2;
//Print the document:
richEditControl1.Print(printerSettings);
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Print(PrinterSettings) method.
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.