This documentation is archived and is not being maintained.

PrintController.OnEndPage Method

When overridden in a derived class, completes the control sequence that determines when and how to print a page of a document.

[Visual Basic]
Public Overridable Sub OnEndPage( _
   ByVal document As PrintDocument, _
   ByVal e As PrintPageEventArgs _
)
[C#]
public virtual void OnEndPage(
 PrintDocument document,
 PrintPageEventArgs e
);
[C++]
public: virtual void OnEndPage(
 PrintDocument* document,
 PrintPageEventArgs* e
);
[JScript]
public function OnEndPage(
   document : PrintDocument,
 e : PrintPageEventArgs
);

Parameters

document
A PrintDocument that represents the document currently being printed.
e
A PrintPageEventArgs that contains the event data.

Remarks

OnEndPage is called immediately after the PrintDocument raises the PrintPage event. If an exception is thrown inside a PrintPage event of a PrintDocument, OnEndPage is not called.

OnStartPrint creates the Graphics object that is sent to the printer. After OnStartPrint is called, the OnStartPage method sets the Graphics object to a graphic of a single page. (Use the OnStartPage method to set how to print a page in a document. For example, you can adjust page settings separately for each page.) The OnEndPage method clears the Graphics object, while the OnEndPrint method deallocates the object.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

PrintController Class | PrintController Members | System.Drawing.Printing Namespace | OnEndPrint | OnStartPage | OnStartPrint | PrintDocument | PrintDocument.PrintPage | PrintPageEventArgs

Show: