|
||
A printer driver is implemented by the following files:
a .pdr
file containing the printer specification data
a .pdl
file that implements the abstract printer driver
interface
a localisable printer name resource 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:
the name and UID of the associated .pdl
file and a
list of the printer models supported by the driver. This is contained inside
the Printer driver file definition statement.
lists of the attributes of each supported printer model, such as minimum margin widths and the typefaces supported. These are contained in one or more Printer model statements.
definitions of each typeface, including the font heights supported, and whether or not it is proportional and/or serif. These are contained in one or more Typeface statements.
information about each font, including the maximum character width, character ascent and the width of each character in the font. This is contained in one or more Font information statements.
lists of translations for unsupported characters, in Translates statements.
lists of command strings that the printer uses to perform operations such as turning bold on and forcing a new page, in a Resources statement.
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\
.
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\
).
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)";};}
};
}