Printing is treated as drawing to a graphics context, with the printer represented by a specialised graphics device. An application that supports printing should store its view data in (device-independent) twips, only converting into pixels when drawing to either the screen or a printer.
EPOC can print to a range of printers, and has a framework for providing printer drivers. This API allows the installed drivers to be listed, and the appropriate one selected.
Device families may provide stock printing dialogs for users to initiate and control print jobs. It is normal for applications that provide printing to supply print job setup (from the Print Framework API) and their printing implementation (the band printing interface described below) to these dialogs, which can then use them as appropriate.
The API has four key concepts: printer model list, printer device, printer port, and band printing interface.
The printer model list gives the possible printers, obtained from the installed printer drivers. To create a printer device, a particular model must be chosen.
The printer model list is provided by
CPrinterModelList
. An entry in the list is a
TPrinterModelEntry
.
This encapsulates the printer being used as a graphics device. Applications draw to this device to print their output. It has:
a page specification, giving the page orientation and the
size (TPageSpec
)
a printer control, which controls the progress and
termination of the print job (CPrinterControl
)
possibly, associated custom print setup dialogs (base class
CPrinterDriverUI
)
It is provided by CPrinterDevice
.
Some printer models require a port to be specified (e.g. file,
serial, parallel). The base class for ports is
CPrinterPort
.