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:

PR_PAPER_10X14

10 x 14 inches

PR_PAPER_11X17

11 x 17 inches

PR_PAPER_A3

297 x 420 mm

PR_PAPER_A4

210 x 297 mm

PR_PAPER_A4SMALL

210 x 297 mm

PR_PAPER_A5

148 x 210 mm

PR_PAPER_B4

250 x 354 mm

PR_PAPER_B5

182 x 257 mm

PR_PAPER_CSHEET

17 x 22 inches

PR_PAPER_DSHEET

22 x 34 inches

PR_PAPER_ENV_9

3 7/8 x 8 7/8 inches

PR_PAPER_ENV_10

4 1/8 x 9 ½ inches

PR_PAPER_ENV_11

4½ x 10 3/8 inches

PR_PAPER_ENV_12

4½ x 11 inches

PR_PAPER_ENV_14

5 x 11½ inches

PR_PAPER_ENV_B4

250 x 353 mm

PR_PAPER_ENV_B5

176 x 250 mm

PR_PAPER_ENV_B6

176 x 125 mm

PR_PAPER_ENV_C3

324 x 458 mm

PR_PAPER_ENV_C4

229 x 324 mm

PR_PAPER_ENV_C5

162 x 229 mm

PR_PAPER_ENV_C6

114 x 162 mm

PR_PAPER_ENV_C65

114 x 229 mm

PR_PAPER_ENV_DL

110 x 220 mm

PR_PAPER_ENV_ITALY

110 x 230 mm

PR_PAPER_ENV_MONARCH

3.875 x 5.5 inches

PR_PAPER_ENV_PERSONAL

3 5/8 x 6 1/2 inches

PR_PAPER_ESHEET

34 x 44 inches

PR_PAPER_EXECUTIVE

7¼ x 101/2 inches

PR_PAPER_FANFOLD_US

14 7/8 x 11 inches

PR_PAPER_FANFOLD_STD_GERMAN

8.5 x 12 inches

PR_PAPER_FANFOLD_LGL_GERMAN

8.5 x 13 inches

PR_PAPER_FOLIO

8.5 x 13 inches

PR_PAPER_LEDGER

17 x 11 inches

PR_PAPER_LEGAL

8.5 x 14 inches

PR_PAPER_LETTER

8.5 x 11 inches

PR_PAPER_LETTERSMALL

8.5 x 11 inches

PR_PAPER_NOTE

8.5 x 11 inches

PR_PAPER_QUARTO

215 x 275 mm

PR_PAPER_STATEMENT

5.5 x 8.5 inches

PR_PAPER_TABLOID

11 x 17 inches

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:

PR_TT_BITMAP

Prints TrueType fonts as graphics. Default action for dot matrix printers.

PR_TT_DOWNLOAD

Downloads TrueType fonts as soft fonts. Default action for Hewlett-Packard printers that use Printer Control Language (PCL).

PR_TT_SUBDEV

Substitute device fonts for TrueType fonts. Default action for PostScript printers.

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:

FALSE

Do not collate when printing multiple copies

TRUE

Collate when printing multiple copies

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:

PR_DMBIN_FIRST

PR_DMBIN_UPPER

PR_DMBIN_UPPER

1

PR_DMBIN_ONLYONE

1

PR_DMBIN_LOWER

2

PR_DMBIN_MIDDLE

3

PR_DMBIN_MANUAL

4

PR_DMBIN_ENVELOPE

5

PR_DMBIN_ENVMANUAL

6

PR_DMBIN_AUTO

7

PR_DMBIN_TRACTOR

8

PR_DMBIN_SMALLFMT

9

PR_DMBIN_LARGEFMT

10

PR_DMBIN_CASSETTE

14

PR_DMBIN_FORMSOURCE

15

PR_DMBIN_LAST

PR_DMBIN_FORMSOURCE

PR_DMBIN_USER

256 - Device-specific bins start here.


RELATED TOPICS

Reports

Report functions