C# Class ApiExamples.ExRendering.MyPrintDocument

The way to print in the .NET Framework is to implement a class derived from PrintDocument. This class is an example on how to implement custom printing of an Aspose.Words document. It selects an appropriate paper size, orientation and paper tray when printing.
Inheritance: System.Drawing.Printing.PrintDocument
Datei anzeigen Open project: aspose-words/Aspose.Words-for-.NET

Public Methods

Method Description
MyPrintDocument ( System.Windows.Forms.Document document ) : System

Protected Methods

Method Description
OnBeginPrint ( System.Drawing.Printing.PrintEventArgs e ) : void

Called before the printing starts.

OnPrintPage ( System.Drawing.Printing.PrintPageEventArgs e ) : void

Called for each page to render it for printing.

OnQueryPageSettings ( System.Drawing.Printing.QueryPageSettingsEventArgs e ) : void

Called before each page is printed.

Method Details

MyPrintDocument() public method

public MyPrintDocument ( System.Windows.Forms.Document document ) : System
document System.Windows.Forms.Document
return System

OnBeginPrint() protected method

Called before the printing starts.
protected OnBeginPrint ( System.Drawing.Printing.PrintEventArgs e ) : void
e System.Drawing.Printing.PrintEventArgs
return void

OnPrintPage() protected method

Called for each page to render it for printing.
protected OnPrintPage ( System.Drawing.Printing.PrintPageEventArgs e ) : void
e System.Drawing.Printing.PrintPageEventArgs
return void

OnQueryPageSettings() protected method

Called before each page is printed.
protected OnQueryPageSettings ( System.Drawing.Printing.QueryPageSettingsEventArgs e ) : void
e System.Drawing.Printing.QueryPageSettingsEventArgs
return void