Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Miscellaneous Printer Updates
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
Windows 3.1 includes several new features that enhance the Windows printing
environment.
 
♦  Indices for DeviceCapabilities Function
 
♦  New Paper Sizes
 
♦  New Members in the DEVMODE Structure
 
♦  RESETDEVICE and STARTDOC Escapes
 
Indices For DeviceCapabilities Function
 
Printer drivers must process requests from applications for new
DeviceCapabilities indices. A driver's DeviceCapabilities function must
check for and process the following:
 
Value                     Meaning
────────────────────────────────────────────────────────────────────────────
DC_ENUMRESOLUTIONS (13)   Retrieves a list of resolutions supported by the
                          model.
 
DC_FILEDEPENDENCIES (14)  Retrieves a list of filenames which also need to
                          be installed when the driver is installed.
 
DC_TRUETYPE (15)          Retrieves the driver's capabilities with regard to
                          printing TrueType fonts.
 
DC_PAPERNAMES (16)        Enumerates the actual string describing the paper
                          names.
 
DC_ORIENTATION (17)       Retrieves the relationship between Portrait and
                          Landscape orientations in terms of the number of
                          degrees that portrait orientation is to be rotated
                          counterclock-wise to get landscape orientation.
 
DC_COPIES (18)            Retrieves the maximum number of copies the device
                          can print.
 
The implementation of one or all of the indices is optional. If a driver
does not implement a given index, the DeviceCapabilities function should
return -1. For more information about the new indices, see the
DeviceCapabilities function.
 
New Paper Sizes
 
There are 21 new predefined paper sizes. The include file, PRINT.H, contains
a complete list of all supported paper sizes. Applications typically call
the DeviceCapabilities function to retrieve names and sizes of the supported
paper sizes, so printer drivers must be ready to process the following
DeviceCapabilities indices:
 
Value          Meaning
────────────────────────────────────────────────────────────────────────────
DC_PAPER       Retrieves the identifiers of the listed paper sizes.
 
DC_PAPERSIZES  Retrieves the width and height of the listed paper sizes.
 
DC_PAPERNAMES  Retrieves the names of the listed paper sizes.
 
New Members in the DEVMODE Structure
 
The dmYResolution and dmTTOption members in the DEVMODE structure are new
for Windows 3.1. The DEVMODE structure returned by the ExtDeviceMode
function contains one or both of these fields if the dmField member includes
the following values:
 
DM_YRESOLUTION  0x0002000L
DM_TTOPTION     0x0004000L
 
The dmYResolution member specifies the vertical resolution of the printer in
dots per inch. In this case, the dmPrintQuality member specifies the
horizontal resolution in dots per inch. If DM_YRESOLUTION bit is not set in
dmFields, dmYResolution is not used and dmPrintQuality retains the original
meaning.
 
The dmTTOption member specifes how TrueType fonts should be printed. The
member can be set to one of the following values:
 
Value              Meaning
────────────────────────────────────────────────────────────────────────────
DMTT_BITMAP (1)    Print TrueType fonts as graphics.
 
DMTT_DOWNLOAD (2)  Download TrueType fonts as soft fonts.
 
DMTT_SUBDEV (3)    Substitute device fonts for TrueType.
 
Note:  Before calling the the CreateDC or CreateIC functions, an application
       should call the DeviceCapabilities function with the DC_TRUETYPE
       index to retrieve the driver's TrueType capabilities. The application
       can use the value returned by the driver to set the dmTTOption member
       to the appropriate value.
 
       The default action is to download TrueType as soft fonts for PCL
       printer; substitute device fonts for TrueType for Pscript printers;
       and to print TrueType fonts as graphics for dotmatrix printers.
 
RESETDEVICE and STARTDOC Escapes
 
The support the ResetDC and StartDoc functions (new for Windows 3.1),
printer drivers must process the RESETDEVICE and STARTDOC escapes in their
Control functions.
 
Although the STARTDOC escape was available in Windows 3.0, the lpInData and
lpOutData parameters have changed. Specifically, lpInData points to a
zero-terminated string specifying the name of the document, and lpOutData
points to a DOCINFO structure specifying the output port or file as well as
the document name. The structure has the following form:
 
typedef struct {
    short   cbSize;
    LPSTR   lpszDocName;
    LPSTR   lpszOutput;         // output port name
} DOCINFO, FAR * LPDOCINFO;
 
The lpszOutput is the name of the output file to use. If either lpOutData or
lpszOutput is NULL, the output port given to CreateDC should be used.
 
The RESETDEVICE escape, corresponding to the new ResetDC function, allows
the driver to move a printer's output state from an old physical device
structure to a new one. This allows applications to change the printer
setup, such as orientation, with creating a new print job. For more
information about this escape, see the RESETDEVICE escape.
 
                                      ♦