The information in this article applies to
- Microsoft Windows Device Driver Kit (DDK) for Windows, version 3.1
SUMMARY
Custom page sizes can be added to the PostScript driver by updating the
source code for the driver contained in the Windows 3.1 DDK. The MKPRN
utility included in the DDK must also be updated. This information is
specific to versions 3.5 through 3.58 of the PostScript driver.
MORE INFORMATION
To make the PostScript driver aware of the custom page size, the
following changes must be made:
- PSCRIPT.RC: The new page size ID and name need to be added to the
STRINGTABLE.
- PAPERSIZ.RC: The ID and page size need to be added to the end of the
PAPERSIZES table, immediately before the NULL entry.
- RESOURCE.H: The ID needs to be defined. It must be a value greater
than 256, even though the other paper sizes IDs are much smaller.
This is because COMMDLG.DLL will not recognize a user defined size
if it's ID is less than 256.
- PRINTERS.H: The "#define DMPAPER_USER_LAST" statement needs to be
changed to define DMPAPER_USER_LAST to the new paper size ID.
The MKPRN utility included with the Windows 3.1 DDK compiles
Adobe-standard PostScript Printer Description files (.PPD files)
to create Windows Printer Description files (.WPD files).
The following changes need to be made to MKPRN to add a custom
size:
- MKPRN.C:
The paper size name and ID need to be added to the paper_table[]
array.
The size of the array needs to be changed. It is originally
defined as PaperSizes[DMPAPER_USER_LAST+1]. This needs to
be incremented by one; however, since the definition of
DMPAPER_USER_LAST also changes in this process (changed in
PRINTERS.H), DMPAPER_USER_LAST should not be used. This
number can be filled in directly, by counting the total
number of paper sizes (including the new one) and adding
one. Or, DMPAPER_USER+2 can be used.
|