The PrintJob Class provides API that allows applications to specify print settings and print ImageGear documents programmatically. This class should be used in conjunction with System.Windows.Printing.PrintDocument class.
In order to print a document, create an instance of System.Printing.PrintDocument class and an instance of PrintJob Class. Initialize the Document property with a reference to the ImageGear document you need to print, and optionally, set other printing parameters. Implement PrintDocument event handlers by calling appropriate methods of the PrintJob class:
- In PrintDocument.BeginPrint handler, call PrintJob.BeginPrint method to initialize the PrintJob instance for printing.
- In PrintDocument.PrintPage handler,
- Use PrintJob.RenderPage method to prepare the visual for printing.
- Use PrintJob.HasMorePages method to check whether the PrintJob has more pages to be printed.
- In PrintDocument.EndPrint handler, call PrintJob.EndPrint method to clean up the PrintJob instance.
Call the Print method of the PrintDocument object to start the printing.
Use AnnotationPages property to print annotations over the document pages.
Use SelectedPageNumbers property to print specific pages of the document.
Use PrintJob(PagePrintSettings) constructor to specify custom page printing settings, such as page layout, margins, header and footer fields for all pages of the document.
In order to customize the printing of specific pages, e.g., apply different page layouts to document pages, use RenderPage(Size, Thickness, PagePrintSettings) method to render pages.