A newer version of this page is available. Switch to the current version.

PrintDocumentEventArgs.PrintDocument Property

Gets the object that sends the document's output to a printer.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v18.2.Core.dll


public PrintDocument PrintDocument { get; }
Public ReadOnly Property PrintDocument As PrintDocument

Property Value

Type Description

A PrintDocument object representing the printing settings of the document.


Use this property to set the printing options that describe how to print the document. Handle the PrintingSystemBase.StartPrint event where you can specify all these options.


The following example demonstrates how to use the PrintDocumentEventArgs object when handling the PrintingSystemBase.StartPrint event. The example below demonstrates how to programmatically select a printer to print a document at runtime.

using System;
using System.Windows.Forms;
using System.Drawing.Printing;
using DevExpress.XtraPrinting;
using DevExpress.Utils;
// ...

// creating a PrintingSystem object
private PrintingSystem printingSystem1 = new PrintingSystem();

private void button1_Click(object sender, System.EventArgs e) {
   // handling the StartPrint event
   printingSystem1.StartPrint += new PrintDocumentEventHandler(printingSystem_StartPrint);

   // printing the document

private void printingSystem_StartPrint(object sender, PrintDocumentEventArgs e) {
   // setting the specific printer's name before printing
   e.PrintDocument.PrinterSettings.PrinterName = PrinterSettings.InstalledPrinters[1];
See Also