[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
DEVMODE
Windows Printer device structure
------------------------------------------------------------------------------
The DEVMODE structure contains information about a printer driver's
initialization and environment data. An application passes this structure
to the DeviceCapabilities and ExtDeviceMode functions.
An application can retrieve the paper sizes and names supported by a
printer by calling the DeviceCapabilities function with the DC_PAPERS,
DC_PAPERSIZE, and DC_PAPERNAMES values.
Before setting the value of the dmTTOption member, applications should
find out how a printer driver can use TrueType fonts by calling the
DeviceCapabilities function with the DC_TRUETYPE value. Drivers can add
device-specific data immediately following the DEVMODE structure.
STRUCTURE:
+--------------------------------------------------------------+
| /* DEVMODE */ |
| |
| typedef struct tagDEVMODE { /* dm */ |
| char dmDeviceName[CCHDEVICENAME]; |
| UINT dmSpecVersion; |
| UINT dmDriverVersion; |
| UINT dmSize; |
| UINT dmDriverExtra; |
| DWORD dmFields; |
| int dmOrientation; |
| int dmPaperSize; |
| int dmPaperLength; |
| int dmPaperWidth; |
| int dmScale; |
| int dmCopies; |
| int dmDefaultSource; |
| int dmPrintQuality; |
| int dmColor; |
| int dmDuplex; |
| int dmYResolution; |
| int dmTTOption; |
| } DEVMODE; |
| |
+--------------------------------------------------------------+
DESCRIPTION:
dmDeviceName Specifies the name of the device the driver supports--
for example, "PCL/HP LaserJet" in the case of the
Hewlett-Packard LaserJet. Each driver has a unique
string.
dmSpecVersion Specifies the version number of the DEVMODE structure.
For Windows version 3.1, this value should be 0x30A.
dmDriverVersion Specifies the printer driver version number assigned
by the printer driver developer.
dmSize Specifies the size, in bytes, of the DEVMODE structure.
(This value does not include the optional dmDriverData
member for device-specific data, which can follow the
structure.) If an application manipulates only the
driver-independent portion of the data, it can use this
member to find out the length of the structure without
having to account for different versions.
dmDriverExtra Specifies the size, in bytes, of the optional
dmDriverData member for device-specific data, which can
follow the structure. If an application does not use
device-specific information, it should set this member
to zero.
dmFields Specifies a set of flags that indicate which of the
remaining members in the DEVMODE structure have been
initialized. It can be any combination (or none) of the
following values:
DM_ORIENTATION 1
DM_PAPERSIZE 2
DM_PAPERLENGTH 4
DM_PAPERWIDTH 8
DM_SCALE 16
DM_COPIES 256
DM_DEFAULTSOURCE 512
DM_PRINTQUALITY 1024
DM_COLOR 2048
DM_DUPLEX 4096
DM_YRESOLUTION 8192
DM_TTOPTION 16384
A printer driver supports only those members that are
appropriate for the printer technology.
dmOrientation Specifies the orientation of the paper. It can be either
DMORIENT_PORTRAIT or DMORIENT_LANDSCAPE.
dmPaperSize Specifies the size of the paper to print on. This member
may be set to zero if the length and width of the paper
are specified by the dmPaperLength and dmPaperWidth
members, respectively. Otherwise, the dmPaperSize member
can be set to a predefined value. Please look up the SDK
for a list of available sizes
dmPaperLength Specifies a paper length, in tenths of a millimeter.
This parameter overrides the paper length specified by
the dmPaperSize member, either for custom paper sizes or
for such devices as dot-matrix printers that can print
on a variety of page sizes.
dmPaperWidth Specifies a paper width, in tenths of a millimeter. This
parameter overrides the paper width specified by the
dmPaperSize member.
dmScale Specifies the factor by which the printed output is to
be scaled. The apparent page size is scaled from the
physical page size by a factor of dmScale/100. For
example, a letter-size paper with a dmScale value of 50
would contain as much data as a page of size 17 by 22
inches because the output text and graphics would be
half their original height and width.
dmCopies Specifies the number of copies printed if the device
supports multiple-page copies.
dmDefaultSource Specifies the default bin from which the paper is fed.
dmPrintQuality Specifies the printer resolution. Following are the four
predefined device-independent values:
DMRES_HIGH [-4]
DMRES_MEDIUM [-3]
DMRES_LOW [-2]
DMRES_DRAFT [-1]
If a positive value is given, it specifies the number of
dots per inch (DPI) and is therefore device-dependent.
If the printer initializes the dmYResolution member, the
dmPrintQuality member specifies the x-resolution of the
printer, in dots per inch.
dmColor Specifies whether a color printer is to render color or
monochrome output.
dmDuplex Specifies duplex (double-sided) printing for printers
capable of duplex printing.
dmYResolution Specifies the y-resolution of the printer, in dots per
inch. If the printer initializes this member, the
dmPrintQuality member specifies the x-resolution of the
printer, in dots per inch.
dmTTOption Specifies how TrueType fonts should be printed. It can
be one of the following values:
DMTT_BITMAP Print TrueType fonts as graphics. This
is the default action for dot-matrix
printers.
DMTT_DOWNLOAD Download TrueType fonts as soft fonts.
This is the default action for Hewlett-
Packard printers that use Printer Control
Language (PCL).
DMTT_SUBDEV Substitute device fonts for TrueType fonts
This is the default action for PostScript
printers.
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson