[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
    Traversing the Document
   [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]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]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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:

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T210437.

Expanded Change Printing 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.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T595964.

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 a Simple Word Processor with a Ribbon UI topic.

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.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.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E3882.


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?​​​​​​​