Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Generating printer drivers

A printer driver is implemented by the following files:


The .pdr file

A .pdr file is a stream store, and is generated by running the pdrtran tool over a text file containing printer specification data. The source text file has the extension .pd. It contains:

A .pdr can contain more than one model because different models are often based on different combinations of the same typefaces. This allows character width tables (which make up the bulk of the data stored) to be shared.

Different .pdr files can reference the same .pdl.

.pdr files are located in \resource\printers\.

[Top]


The .pdl file

A .pdl file is a plugin DLL for a printer driver. It must implement the abstract printer driver interface defined by CPdrDevice and CPdrControl. The derived classes CFbsDrvDevice and CFbsDrvControl provide support for bitmap-based printing, and are usually derived from.

The ordinal 1 function exported from the DLL creates and returns a pointer to an instance of the derived printer device class.

The mmp file for the DLL needs to specify PDL as the targettype, and 0x10003B1C as its second UID. The third UID is the PDLUid value specified in the Printer driver file definition statement.

.pdl files are located in the standard loction for DLLs (under \sys\bin\).

[Top]


The resource file

This is an optional resource file, (localisable using a .rNN extension, where NN is a language code), that maps the UIDs of all the printer models supported by the driver (as specified in the Printer model statements) to their names, potentially in different languages, for display in the UI. It is located in \resource\printers\.

If this file does not exist for a given locale the device name specified in the Printer Model Statement of the .pd file will be used.

Here is an example (for the .pd illustrated here). Note that in this instance the localised printer names are the same as those in the .pd file.

// EPSON.RSS
//
// Copyright (c) 2000 Symbian Ltd.  All rights reserved.
//

#include "epson.rls"
#include <badef.rh>
#include <uikon.rh>

NAME EPSO

RESOURCE RSS_SIGNATURE {}

RESOURCE ARRAY
    {
    items=
        {
        UID_NAME_PAIR {uid=268435817; name=LBUF {txt="Epson LQ-860";};},   // localised printer name
        UID_NAME_PAIR {uid=-1610611287; name=LBUF {txt="Citizen PN60";};},
        UID_NAME_PAIR {uid=268439229; name=LBUF {txt="Canon Bubblejet (LQ mode)";};}
        };
    }