The Windows CE PCL printer driver seems to be a little bit simple in its support of different Dots Per Inch (DPI) settings. It only supports two; 150 and 300 DPI. Interesting since there appear to be settings for low and high resolution DPI in the registry for each printer, and they are different for the default printers. In this article, I will explain how to clone the PCL driver and modify to hard code new DPI settings – I will leave a fancier implementation up to you.
Steps that I used to modify the PCL driver:
1.       Sysgen a project that includes printer support
2.       Create a new folder in my platform’s driver folder named PCLPrinter
3.       Copy Public\Common\Oak\Drivers\Printer\PCL folder to the new PCLPrinter folder so that it is a subfolder
4.       Create a new folder named DLL as a subfolder of PCLPrinter
5.       Open a build window and change directories to the PCLPrinter\DLL folder
6.       Run “sysgen_capture pcl”
7.       Change the name of sources.pcl to sources
8.       Delete all of the other files in the PCLPrinter\DLL leaving only the sources file
9.       Copy PCLPrinter\PCL\makefile to PCLPrinter\DLL
10.   Create a PCLPrinter\Dirs file that includes:
                PCL \
11.   Edit PCLPrinter\PCL\sources:
a.       Delete the following lines:
                                                               i.      INCLUDES=
                                                             ii.      WINCETARGETFILE0=$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\pcl.def
                                                            iii.      #xref VIGUID {2a68580f-ecda-4b7c-935b-303362e741d3}
                                                           iv.      #xref VSGUID {381348d4-def9-40a6-8285-4f899762f6d1}
12.   Edit PCLPrinter\DLL\sources to modify to following lines:
a.       DEFFILE=$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\pcl.def to DEFFILE=..\PCL\pcl.def
b.      $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\pcllib.lib \ to $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\pcllib.lib \
13.   Test build the driver
14.   Modify PCLPrinter\PCL\ddi.cpp:
a.       Change the RES_HIGH and RES_LOW macros to numbers that make sense for your printer
                                                               i.      #define RES_HIGH        600
                                                             ii.      #define RES_DRAFT       300
b.      Change the page size macros for xPels and yPels to numbers that make sense for your RES_HIGH value. Microsoft did this the hard way by hard coding numbers, if you move the RES_HIGH definition to above these you can use it in the definitions. If you divide the current values by the original RES_HIGH value you will have a value to multiply by RES_HIGH. Example: #define LETTER_xPels    (DWORD)(8.5 * RES_HIGH)
15.   Build and test the driver
Now you have a PCL printer driver that can print higher definition. 
Copyright © 2009 – Bruce Eitman
All Rights Reserved