pdrstore: Creating a Printer Driver using pdr files

Description

This example demonstrates how to load printer driver information files and create a printer driver. The purpose of the PdrStore API is to:

  • Provide access to the printer driver information contained in .pdr files for applications to build a printer driver list

  • Load and create an appropriate printer driver for a given printer.

During initialisation, the example first loads the printer driver, then creates a session with the font and bitmap server. This is detailed in the following sections.

Download

Click on the following link to download the example: PDRStore.zip

Click: browse to view the example code.

Create a printer driver

void CPdrExample::CreatePrinterDriver()

This function provides the following funtionality:

Display the supported typefaces

void CPdrExample::DisplayTypefaces()

Gets the list of supported typefaces using CPrinterDevice::TypefaceSupport(TTypefaceSupport &,TInt) const and displays them.

Create a printer control

void CPdrExample::CreatePrinterControl()

Creates a printer control using CPrinterDevice::CreateControlL().

Preparing for printing

void CPdrExample::PrintPages()

This function prepares the printer driver for printing the pages. It involves the following:

Usage

This is a console application, so does not have a GUI. It builds an executable called pdrstoreexample.exe in the standard location (\epoc32\release\winscw\ <build_variant> for CodeWarrior). The Symbian platform build process describes how to build this application. After launching the executable, depending on the emulator you are using, you may need to task away from the app launcher/shell screen to view the console.