Back to Devexpress

RichEditDocumentServer.Print(PrinterSettings, String) Method

officefileapi-devexpress-dot-xtrarichedit-dot-richeditdocumentserver-dot-print-x28-system-dot-drawing-dot-printing-dot-printersettings-system-dot-string-x29.md

latest3.2 KB
Original Source

RichEditDocumentServer.Print(PrinterSettings, String) Method

Prints the document with the given printer settings and document name.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public void Print(
    PrinterSettings printerSettings,
    string printDocumentName
)
vb
Public Sub Print(
    printerSettings As PrinterSettings,
    printDocumentName As String
)

Parameters

NameTypeDescription
printerSettingsPrinterSettings

A PrinterSettings instance containing printer settings.

| | printDocumentName | String |

A string indicating the document name to be printed.

|

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.) and a custom name to print the target document.

Note

PrinterSettings properties, such as PageSettings.Margins or PageSettings.Landscape (accessible by 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.

Warning

The Print(PrinterSettings, String) method overload works only on Windows OS. The PlatformNotSupportedException is thrown on other operating systems. Use the Print method overloads with DXPrinterSettings printerSettings parameter to print on other operating systems.

Example

View Example

cs
// Load a document from a file.
wordProcessor.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);

// Print the document to the default printer with the default settings.
wordProcessor.Print();
vb
' Load a document from a file.
wordProcessor.LoadDocument("Documents\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
' Print the document to the default printer with the default settings.
wordProcessor.Print()

See Also

RichEditDocumentServer Class

RichEditDocumentServer Members

DevExpress.XtraRichEdit Namespace