[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Expand]RichEditControl Document
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Track Changes
    Mail Merge
    Restrictions and Protection
   [Expand]Visual Elements
    HTML Tag Support
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


This document outlines the following techniques used to print from RichEditControl:

Expanded Print Documents Using the Default Printer

RichEditControl allows you to print a document with the default settings without end-user interaction by calling the RichEditControl.Print method.

Call the Print method with the passed System.Drawing.Printing.PrinterSettings instance to specify the desired printer options (the range of pages to print, the number of copies, etc.) to print a document, as shown below:

You can specify additional printing settings (whether to print the comments' background color or update document variables before printing) using the DXRichEditPrintingOptions (see DXRichEditPrintingOptions) class properties. Access an object using the RichEditControl.PrintingOptions property, as shown below:

Expanded Commands

DXRichEdit provides the following built-in commands for printing documents.

Command Description
PrintCommand Invokes the Print dialog to print the current document.
QuickPrintCommand Prints the current document using the default printer. The command is executed without user intervention.
PrintPreviewCommand Displays the Print Preview window for the current document.

All built-in commands are available on the File ribbon tab. To learn how to provide an application with the Ribbon Command UI, check the Lesson 5 - Create Separate Ribbon Pages for a Rich Text Editor topic.


You can restrict end-users from printing documents. Set the DXRichEditBehaviorOptions.Printing property to DocumentCapability.Disabled or DocumentCapability.Hidden to disable or hide the corresponding commands in the Ribbon UI and the pop-up menu.

Expanded DevExpress Printing Library

To specify additional printing settings, use the DevExpress Printing Library and the RichEditDocumentServer instance. The API from the table below allows you to accomplish this task as shown in the following code example.

Member Description
DevExpress.XtraRichEdit.RichEditDocumentServer.%23ctor Initializes a new instance of the RichEditDocumentServer class with the default settings.
DevExpress.Xpf.Printing.LegacyPrintableComponentLink.%23ctor* Initializes a new instance of the LegacyPrintableComponentLink class with the specified settings.
LinkBase.CreateDocument Creates a document from the link, so it can be displayed or printed. Optionally, the document pages can be generated progressively and accessed as soon as they are created. Document creation is always synchronous and does not occur in a background thread.
LinkBase.PrintingSystem Gets the Printing System used to create and print a document for this link.
LinkBase.PrintDirect Prints the current document to a default printer.

Such LegacyPrintableComponentLink properties as LinkBase.Landscape or LinkBase.PaperKind do not affect the layout of a printed document. To change the document page layout properties before printing, change the corresponding settings of the document section (can be accessed by the Section.Page property).

Expanded XpfRichEditPrinter class descendant

To use the FixedDocument (see System.Windows.Documents.FixedDocument) instance in your custom printing logic, use the XpfRichEditPrinter class. Declare a class descendant and implement the methods according to your current needs.

The code snippet below shows how to use this class to set a printer directly from code without showing the printer dialog.

Is this topic helpful?​​​​​​​