Skip to end of metadata
Go to start of metadata

Remarks

PrintDocument class will use the Print method to print the document. Print method needs two parameters, DocumentPaginator object and the document name. DocumentPaginator is an abstract base class that supports creation of multiple-page elements from a single document. By default, each FixedDocument has DocumentPaginator property that contain DocumentPaginator object for the fixed document.

CS
Additionally, you can specify a custom paginator class to add custom elements for printing purpose only, such as header or footer. To learn more about how to implement custom paginator class for printing purpose, see How-to: Use Custom Paginator to Print FixedDocument. To learn more about how to implement custom paginator class in UXDocumentViewer, see How-to: Use Custom Paginator in UXDocumentViewer.

Definition

public class PrintDocument

Summary

The following table summarizes the members exposed in this class.

Public Constructors

PrintDocument Constructor()Initializes a new instance of PrintDocument class.

Public Methods

Print(DocumentPaginator, string, PrintDocumentMode)Prints a DocumentPaginator object.

Events

BeginPrintOccurs after the System.Windows.Printing.PrintDocument.Print() method is called and the print dialog box successfully returns, but before the System.Windows.Printing.PrintDocument.PrintPage event is raised.
EndPrintOccurs when the printing operation is complete or when the print operation is cancelled by the application author.
PrintPageOccurs when each page is printing.

Public Constructors

public PrintDocument()

Initializes a new instance of PrintDocument class.

Public Methods

public void Print(DocumentPaginator paginator, string documentName, PrintDocumentMode printMode)

Prints a DocumentPaginator object.

Parameters

paginatorThe DocumentPaginator object to print.
documentNameA description of the job that is to be printed. This text appears in the user interface (UI) of the printer.
printMode 

 

Events

public event EventHandler<BeginPrintEventArgs> BeginPrint

Occurs after the System.Windows.Printing.PrintDocument.Print() method is called and the print dialog box successfully returns, but before the System.Windows.Printing.PrintDocument.PrintPage event is raised.

public event EventHandler<EndPrintEventArgs> EndPrint

Occurs when the printing operation is complete or when the print operation is cancelled by the application author.

public event EventHandler<PrintPageEventArgs> PrintPage

Occurs when each page is printing.

  • No labels