RichEditDocumentServer.Print(PrinterSettings) Method
Prints the document with the given printer settings.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.RichEdit.v24.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
#Declaration
public void Print(
PrinterSettings printerSettings
)
#Parameters
Name | Type | Description |
---|---|---|
printer |
Printer |
A Printer |
#Remarks
Call the Print
method to specify the desired options (define the printer name, the number of copies, the paper size, enable double-sided printing, etc.) to print the document.
Note
Printer
Warning
The Print
method overload works only on Windows OS. The Platform
is thrown on other operating systems. Use the Print
method overloads with DXPrinter
parameter to print on other operating systems.
#Example
using DevExpress.XtraRichEdit;
using System.Drawing.Printing;
using (var wordProcessor = new RichEditDocumentServer())
{
wordProcessor.LoadDocument("Grimm.docx");
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:
wordProcessor.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.