Class PrintDocument
Defines a reusable object that sends output to a printer, when printing from an AlterNET UI application.
public class PrintDocument : HandledObject<IPrintDocumentHandler>, IBaseObject, IDisposableObject, IDisposable, INotifyPropertyChanged
- Inheritance
-
PrintDocument
- Implements
Remarks
Typically, you create an instance of the PrintDocument class, set properties such as the DocumentName and PrinterSettings, and call the Print() method to start the printing process. Handle the PrintPage event where you specify the output to print, by using the DrawingContext property of the PrintPageEventArgs.
Constructors
- PrintDocument()
Initializes a new instance of the PrintDocument class.
Properties
- DocumentName
Gets or sets the document name to display (for example, in a print status dialog box or printer queue) while printing the document.
- OriginAtMargins
Gets or sets a value indicating whether the position of a graphics object associated with a page is located just inside the user-specified margins or at the top-left corner of the printable area of the page.
- PageSettings
Gets or sets page settings that are used for all pages to be printed.
- PrinterSettings
Gets the printer settings for this document.
Methods
- CreateHandler()
Creates handler.
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- OnBeginPrint(PrintEventArgs)
Raises the BeginPrint event. It is called after the Print() method is called and before the first page of the document prints.
- OnEndPrint(PrintEventArgs)
Raises the EndPrint event. It is called when the last page of the document has printed.
- OnPrintPage(PrintPageEventArgs)
Raises the PrintPage event. It is called before a page prints.
- Print()
Starts the document's printing process.
Events
- BeginPrint
Occurs when the Print() method is called and before the first page of the document prints.
- EndPrint
Occurs when the last page of the document has printed.
- PrintPage
Occurs when the output to print for the current page is needed.