## Printer Device Driver

[prev][next][parent][TOC]

### Changing the Driver Name

Although the code provided in the DDK builds to "PSCRIPT.DRV", it is recommended that you use a name other than "PSCRIPT.DRV" for your own driver. This section describes how to change the driver's name.

To change the file name of the driver, the following components must be altered:

Extended attributes Extended attributes are read by the print object that installs the driver in a specific path. The path is \OS2\DLL followed by a path that has the same name as the driver. For example, the path for the OS /2 PostScript driver is \OS2\DLL\PSCRIPT.

Driver contents The current driver stores printer-properties selections in OS2SYS.INI. The application string in the INI is in the following format:

      "PM_DD_"[name of print object]","[driver name]"."[device name]

where the:

name of print object is the name of the printer object where printer properties were stored

driver name is the name of the driver file-for the OS/2 PostScript driver, the string is "PSCRIPT"

device name is the name of the printer that is displayed in the print object's Settings dialog.

To set and retrieve data from the INI file, the driver uses the hard-coded string "PSCRIPT" to create a string that is then used to set/query the data in the INI file. If you change the name of the driver, you must also change the name of this string; otherwise, you may be querying and setting the wrong INI entry.

The following example shows you how to change the name of the driver " PSCRIPT.DRV" to "SAMPLE.DRV":

1.First, change the contents of a file called "PKGPS.CMD". This batch file sets the extended attributes for the driver. Change all occurrences of " PSCRIPT" to the name of your driver-e.g., change "PSCRIPT" to "SAMPLE".

2.Make changes to several functions of the driver where "PSCRIPT" is hard coded. Replace the string "PSCRIPT" with the name of your driver-e.g., change "PSCRIPT" to "SAMPLE". Below is a list of source files that need to be changed and the locations where changes are needed:

CONFIG.C Change HELPFILENAME to include driver name, PrintFontMem

DEVBLOCK.C BuildKeyName, prde_FillPdb

DEVMODE.C OS2_PM_DRV_DEVMODE, GetPrinterName

QUERYBOX.C WrtQueryProfile

UTLLOG.C LogIsOn

SOFTFONT.H Change string accessed by FONT_DIR_APP from "PM_PSCRIPT" to "PM_ " followed by the driver name

3.Change the makefile. In the makefile, the minimum change that you must make is to change all occurrences of "PSCRIPT.DRV" and "PSCRIPT.HLP" to include the name of your driver-e.g., "SAMPLE.DRV" and "SAMPLE.HLP".

You can also change all other occurrences of "PSCRIPT", including path names and other file names; but this is not required.

4.The conversion is now complete, and you are ready to rebuild the new driver. When installing from the print object, select Other OS/2 printer driver and specify the path of your driver. Your driver will install on the path OS2\DLL followed by the name of your driver-e.g., SAMPLE.DRV will install on \OS2\DLL\SAMPLE. This path will include SAMPLE.DRV and SAMPLE. HLP.