Printer Drivers

Windows CE versions 2.0 and later include support for printing. The printing model used by Windows CE is a subset of the printing model defined for desktop Windows-based platforms. Only a small number of the graphics driver functions defined for printer drivers are required in printer drivers for Windows CE.

The following sections of the Windows CE Device Driver Kit documentation describe the interaction between Windows CE–based printer drivers and Windows CE–based display mechanisms. These sections also describe the functions that printer drivers must implement and the port monitor functions that printer drivers call to send data to printers.

The Windows CE Graphical Display Interface (GDI) and display driver perform most of the work involved in printing. At the beginning of the printing process, the GDI creates a device context (DC) with attributes retrieved from the printer driver during a call to the DrvEnablePDEV function. The display driver is used to render subsequent drawing commands issued from the application into the DC; the printer driver does not render the document. Then, the GDI sends the resulting bitmap to the printer driver so that the printer driver can format it and send it to the printer. To conserve memory, the GDI renders the document in bands, which are horizontal sections of the page, and makes several calls to the printer driver to send the rendered bands to the printer.

Windows CE–based printer drivers are required to implement only those graphics driver functions necessary for gathering printer metrics, for setting up the printer, for starting and ending print jobs, and for preparing rendered strips for printing. Internally, the printer driver converts the bitmap data from a GDI bitmap format into the format required by the printer. This can include operations such as color reduction to the color space of the printer, data compression, and data conversion into the format used by the printer, a format sometimes known as a printer description language. Finally, the printer driver calls the port monitor to send the rendered strips to the printer.

Windows CE–based printer drivers are compiled as dynamic-link libraries (DLLs). As a result, they must export the DrvEnableDriver function.

For more information about Windows CE–based printer drivers, see Functions Implemented by Printer Drivers and Registry Keys for Printer Drivers.