Setting a new value for a print property¶
SetPrintProperty() |
Set a new value for a print property |
SYNTAX
SetPrintProperty(printer_name, property_number, new_value)
Sets a print property for the printer specified in printer_name to a new value. The property numbers are listed below. The new_value specified is used by all reports printed by the program. Note that not all properties are supported by all print drivers; also, setting a property such as print resolution will not work if the property is then changed by an entry in the printer parameter file.
The properties currently available are listed below. Either the property number or name may be used. The property names are definitions included in the file <printer.h>.
1 |
PP_DEVICENAME |
Printer name. Corresponds to the dmDeviceName member of the Windows DEVMODE structure. This property cannot be set, only retrieved. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 |
PP_SPECVERSION |
The version number of the initialisation data used for the default printer settings. Corresponds to the dmSpecVersion member of the Windows DEVMODE structure. This property cannot be set, only retrieved. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 |
PP_DRIVERVERSION |
The printer driver version number. Corresponds to the dmDriverVersion member of the Windows DEVMODE structure. This property cannot be set, only retrieved. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 |
PP_ORIENTATION |
Selects the orientation of the printout. Corresponds to the dmOrientation member of the Windows DEVMODE structure. Can be set to PR_ORIENT_PORTRAIT or PR_ORIENT_LANDSCAPE. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 |
PP_PAPERSIZE |
Selects the paper size. Corresponds to the dmPaperSize member of the Windows DEVMODE structure. Paper size can also be set using PP_PAPERLENGTH and PP_PAPERWIDTH. Values are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 |
PP_PAPERLENGTH |
The paper length in tenths of a millimetre. Corresponds to the dmPaperLength member of the Windows DEVMODE structure. This value over-rides the paper length set by PP_PAPERSIZE for custom paper sizes and for devices such as dot matrix printers, which can print on a page of arbitrary length. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 |
PP_PAPERWIDTH |
The paper width in tenths of a millimetre. Corresponds to the dmPaperWidth member of the Windows DEVMODE structure. This value over-rides the paper width set by PP_PAPERSIZE for custom paper sizes and for devices such as dot matrix printers. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 |
PP_SCALE |
Percentage by which the apparent page size is scaled to the physical page size. Corresponds to the dmScale member of the Windows DEVMODE structure. For example, a letter-sized page with a scale value of 50 would contain as much data as a page of 17 by 22 inches, because the output text and graphics would be half their original height and width. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 |
PP_COPIES |
The number of copies to print if the printer supports multiple copies. Corresponds to the dmCopies member of the Windows DEVMODE structure. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 |
PP_PRINTQUALITY |
The required print resolution. Corresponds to the dmPrintQuality member of the Windows DEVMODE structure. There are four, device-independent values: PR_RES_DRAFT, PR_RES_LOW, PR_RES_MEDIUM and PR_RES_HIGH. These special values are defined as negative numbers. If a positive value is set, it specifies the number of dots per inch (DPI) and is device-dependent. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 |
PP_COLOR |
Switches between colour and monochrome on colour printers. Corresponds to the dmColor member of the Windows DEVMODE structure. The available values are PR_COLOR and PR_MONOCHROME. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 |
PP_DUPLEX |
Selects duplex or double-sided printing for papers capable of duplex printing. Corresponds to the dmDuplex member of the Windows DEVMODE structure. The available values are PR_DUP_SIMPLEX, PR_DUP_HORIZONTAL and PR_DUP_VERTICAL. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 |
PP_YRESOLUTION |
Specifies the resolution, in dots per inch, of the printer. Corresponds to the dmYResolution member of the Windows DEVMODE structure. If the printer initialises this property, the PP_PRINTQUALITY member specifies the x-resolution, in dots per inch, of the printer. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 |
PP_TTOPTION |
Specifies how TrueType fonts should be printed. Corresponds to the dmTTOption member of the Windows DEVMODE structure. Values are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 |
PP_COLLATE |
Specifies whether collation should be used when printing multiple copies. Corresponds to the dmCollate member of the Windows DEVMODE structure. This member is ignored unless the printer driver indicates support for collation by setting the dmFields member to DM_COLLATE. Values are:
Setting PP_COLLATE to TRUE provides faster, more efficient output for collation, since the data is sent to the device driver only once, no matter how many copies are printed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 |
PP_LOGPIXELS |
Specifies the number of pixels per logical inch. Corresponds to the dmLogPixels member of the Windows DEVMODE structure. Printer drivers do not use this member, which is provided for information only. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 |
PP_DEFAULTSOURCE |
The user-selected print bin. Values are:
|
RELATED TOPICS |