Print Jobs
The CPrintJob class encapsulates the task of sending a document to a printer. A print job takes a printable object and a document and coordinates the task of printing to the document. When a print job is started, it uses the IPrintable interface implemented by the printable object to print pages to the document.
The CPrintJob class uses the IPrintable interface and CPrintDoc classes. At the beginning of a job, CPrintJob calls the StartDoc() function on the CPrintDoc object and is returned an integer value that identifies the job on that printer. Once CPrintJob has started a job on the printer by calling StartDoc(), it invokes the virtual OnPrintDocument() method, which iterates over the pages contained by the printable object and prints them. The CPrintJob class also implements functions for controlling the print job such as Cancel(), Pause(), Resume(), Restart(), Delete() and SetPriority().