[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Expand]RichEditControl Document
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Spell Checking
    AutoCorrect
    Mail Merge
    Restrictions and Protection
    Syntax Highlighting
   [Expand]Visual Elements
    Services
    Events
    Commands
    Keyboard Shortcuts
    HTML Tag Support
   [Expand]Examples
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Printing

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. To do that, use the RichEditControl.Print method as shown below:

Expanded Change Print Settings

Call the RichEditControl.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.

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

Expanded Print Documents using the Command UI

RichEditControl provides the following built-in commands to print the document.

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 printing commands are available on the File Ribbon tab. To learn how to provide your application with the Ribbon Command UI, refer to the How to: Create the RichEditControl with a Ribbon UI topic.

Tip

You can disable printing documents from the User Interface. Set the RichEditBehaviorOptions.Printing property to DocumentCapability.Hidden or DocumentCapability.Disabled to disable or hide the corresponding commands in the Ribbon UI and the pop-up menu.

Expanded DevExpress Printing Library

To set options that are unavailable from RichEditControl directly, use the DevExpress Printing Library. This library has the PrintableComponentLink class, which allows you to change required printing settings (e.g., use the specific printer or disable showing error messages). For this, use the API from the table below as shown in the following code snippet.

Member Description
PrintableComponentLink (see PrintableComponentLink.PrintableComponentLink) Creates a new PrintableComponentLink instance with a given printing system.
PrintableComponentLinkBase.Component Sets user implementation represented by the IPrintable instance for the current component link.
PrintableComponentLink.PrintingSystem Obtains settings provided by the given PrintingSystem instance.
PrintableComponentLink.Print Prints the current document using the specified printer.
Important

Such PrintableComponentLink 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 a document section ( accessed by the Section.Page property).

Expanded See Also

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