constants FieldsEnum
The FieldsEnum type defines the list of fields that user can change before previewing or printing an object. Use the Settings property to access the printer field's value. Use the Preview method to preview an object.  Use the DoPrint method to print an object.

NameValueDescription
exPaperSize0 The exPaperSize property gets or sets the size of the paper on which the document will be printed. The exFormName property gets the name of the paper form or size that the printer uses. This property must be assigned one of the predefined values from the available list of standard paper sizes to ensure correct formatting and output.

For instance, 

  • Settings(exPaperSize) = 9, configures the paper size to A4, which measures 210 x 297 millimeters. This value corresponds to the predefined constant DMPAPER_A4 in the system’s paper size enumeration. It ensures that any printed or previewed content will be formatted for standard A4 dimensions, commonly used in international document layouts.

Just because a value exists in the Windows API does not mean your printer driver supports it. Always check supported paper sizes via the printer capabilities.

Constant Name              Value  Description                     Dimensions (mm)
-------------------------  -----  ------------------------------  -----------------
DMPAPER_LETTER                 1  Letter                          215.9 x 279.4
DMPAPER_LETTERSMALL            2  Letter Small                    215.9 x 279.4
DMPAPER_TABLOID                3  Tabloid                         279.4 x 431.8
DMPAPER_LEDGER                 4  Ledger                          431.8 x 279.4
DMPAPER_LEGAL                  5  Legal                           215.9 x 355.6
DMPAPER_STATEMENT              6  Statement                       139.7 x 215.9
DMPAPER_EXECUTIVE              7  Executive                       184.15 x 266.7
DMPAPER_A3                     8  A3                              297 x 420
DMPAPER_A4                     9  A4                              210 x 297
DMPAPER_A4SMALL               10  A4 Small                        210 x 297
DMPAPER_A5                    11  A5                              148 x 210
DMPAPER_B4                    12  B4 (JIS)                        250 x 354
DMPAPER_B5                    13  B5 (JIS)                        182 x 257
DMPAPER_FOLIO                 14  Folio                           215.9 x 330.2
DMPAPER_QUARTO                15  Quarto                          215 x 275
DMPAPER_10X14                 16  10 x 14 in                      254 x 355.6
DMPAPER_11X17                 17  11 x 17 in                      279.4 x 431.8
DMPAPER_NOTE                  18  Note                            215.9 x 279.4
DMPAPER_ENV_9                 19  Envelope #9                     98.4 x 225.4
DMPAPER_ENV_10                20  Envelope #10                    104.8 x 241.3
DMPAPER_ENV_11                21  Envelope #11                    114.3 x 263.5
DMPAPER_ENV_12                22  Envelope #12                    120.7 x 279.4
DMPAPER_ENV_14                23  Envelope #14                    127 x 292.1
DMPAPER_CSHEET                24  C Sheet 17 x 22 in              431.8 x 558.8
DMPAPER_DSHEET                25  D Sheet 22 x 34 in              558.8 x 863.6
DMPAPER_ESHEET                26  E Sheet 34 x 44 in              863.6 x 1117.6
DMPAPER_ENV_DL                27  Envelope DL                     110 x 220
DMPAPER_ENV_C5                28  Envelope C5                     162 x 229
DMPAPER_ENV_C3                29  Envelope C3                     324 x 458
DMPAPER_ENV_C4                30  Envelope C4                     229 x 324
DMPAPER_ENV_C6                31  Envelope C6                     114 x 162
DMPAPER_ENV_C65               32  Envelope C65                    114 x 229
DMPAPER_ENV_B4                33  Envelope B4                     250 x 353
DMPAPER_ENV_B5                34  Envelope B5                     176 x 250
DMPAPER_ENV_B6                35  Envelope B6                     176 x 125
DMPAPER_ENV_ITALY             36  Envelope Italy                  110 x 230
DMPAPER_ENV_MONARCH           37  Envelope Monarch                98.4 x 190.5
DMPAPER_ENV_PERSONAL          38  6 3/4 Envelope                  92.1 x 165.1
DMPAPER_FANFOLD_US            39  US Std Fanfold                  368.3 x 279.4
DMPAPER_FANFOLD_STD_GERMAN    40  Std German Fanfold              210 x 305
DMPAPER_FANFOLD_LGL_GERMAN    41  Legal German Fanfold            210 x 330
DMPAPER_ISO_B4                42  ISO B4                          250 x 353
DMPAPER_JAPANESE_POSTCARD     43  Japanese Postcard               100 x 148
DMPAPER_9X11                  44  9 x 11 in                       228.6 x 279.4
DMPAPER_10X11                 45  10 x 11 in                      254 x 279.4
DMPAPER_15X11                 46  15 x 11 in                      381 x 279.4
DMPAPER_ENV_INVITE            47  Envelope Invite                 220 x 220
DMPAPER_LETTER_EXTRA          50  Letter Extra                    235.5 x 304.8
DMPAPER_LEGAL_EXTRA           51  Legal Extra                     235.5 x 381
DMPAPER_TABLOID_EXTRA         52  Tabloid Extra                   304.8 x 457.2
DMPAPER_A4_EXTRA              53  A4 Extra                        236 x 322
DMPAPER_LETTER_TRANSVERSE     54  Letter Transverse               215.9 x 279.4
DMPAPER_A4_TRANSVERSE         55  A4 Transverse                   210 x 297
DMPAPER_LETTER_EXTRA_TRANSVERSE 56 Letter Extra Transverse        235.5 x 304.8
DMPAPER_A_PLUS                57  Super A                         227 x 356
DMPAPER_B_PLUS                58  Super B                         305 x 487
DMPAPER_A2                    66  A2                              420 x 594
DMPAPER_A1                    70  A1                              594 x 841
DMPAPER_A0                    71  A0                              841 x 1189

Note: The table lists official paper size constants and their values as defined in the Windows SDK (wingdi.h).

(long expression)

exPaperSource1

The exPaperSource property gets or sets the paper source. The member accepts one of the following predefined values:

  • DMBIN_ONLYONE (1), Only one paper tray available
  • DMBIN_LOWER (2), Lower paper tray
  • DMBIN_MIDDLE (3), Middle paper tray
  • DMBIN_MANUAL (4), Manual feed source
  • DMBIN_ENVELOPE (5), Envelope feed source
  • DMBIN_ENVMANUAL (6), Manual envelope feed source
  • DMBIN_AUTO (7), Automatically select source
  • DMBIN_TRACTOR (8), Tractor feed
  • DMBIN_SMALLFMT (9), Small format paper source
  • DMBIN_LARGEFMT (10), Large format paper source
  • DMBIN_LARGECAPACITY (11), Large capacity paper source
  • DMBIN_CASSETTE (14), Paper cassette
  • DMBIN_FORMSOURCE (15), Forms source

For instance, 

  • Settings(exPaperSource) = 9, sets the paper source to use the Small Format tray.

(long expression)

exPageOrientation2

The exPageOrientation property gets or sets the direction in which the content is printed on the page. It determines whether the page is taller than it is wide (portrait) or wider than it is tall (landscape). The PageOrientation property is equivalent of Settings(exPageOrientation) option.

Accepted values:

  • DMORIENT_PORTRAIT (1), The page is oriented vertically. This is the standard format used for most documents like letters or forms.
  • DMORIENT_LANDSCAPE (2), The page is oriented horizontally. This is useful for wide content such as spreadsheets or charts.

Use this property to match the layout of your content with the appropriate paper orientation.

For instance, 

  • Settings(exPageOrientation) = 2, configures the page orientation to Landscape mode

(long expression)

exPrinterName3

The exPrinterName property gets or sets the user-friendly name of the selected printer or display device. For example, it may return a name like "Xerox WorkCentre 3025" for a compatible Xerox printer. This name uniquely identifies the printer among all installed device drivers on the system. To obtain a list of all available printers, use the Printers property.

Important: If you intend to change the selected printer by setting exPrinterName, you must do so before configuring any other printer-related settings. Otherwise, the new printer settings may not take effect correctly.

For instance, 

  • Settings(exPrinterName) = "Microsoft Print to PDF", sets the printer to Microsoft Print to PDF

(string expression)

exPrinterCopies4 The exPrinterCopies property gets or sets how many copies of the document will be printed, provided that the printer supports printing multiple copies in a single job.

For instance, 

  • Settings(exPrinterCopies) = 4, configures the printer to print 4 copies of the document

(long expression)

exPrintQuality5

The exPrintQuality property gets or sets the printer resolution. It supports four predefined device-independent values, each corresponding to a specific print quality level:

  • DMRES_HIGH (-4), provides the highest print resolution available, producing sharp and detailed output, suitable for professional-quality documents and images.
  • DMRES_MEDIUM (-3), offers a balanced print resolution that maintains good quality while using less ink or toner, ideal for everyday documents.
  • DMRES_LOW (-2), sets a lower print resolution to save resources, resulting in faster printing and reduced ink usage, but with less detail and sharpness.
  • DMRES_DRAFT (-1), uses the lowest print resolution, primarily for draft copies where speed and ink conservation are more important than print quality.

Alternatively, if a positive value is specified, it indicates the number of dots per inch (DPI) for the printer, which depends on the device's capabilities and may vary between printers.

For instance:

  • Settings(exPrinterCopies) = -4, configures the printer to use high resolution

(long expression)

exLeftMargin6

The exLeftMargin property gets or sets the width of the left margin. The unit of measurement depends on the value of the exDisplayInch property:

  • If exDisplayInch is set to 0, the margin is measured in thousandths of an inch.
  • If exDisplayInch is set to 1, the measurement is in millimeters.

This property allows for precise control over page layout. For example, a setting of 1500 indicates a left margin of 1.5 inches when measured in thousandths of inches.

For instance:

  • Settings(exLeftMargin) = 2000, sets the left margin to 2.0 inches (when exDisplayInch is 0).

(long expression)

exTopMargin7

The exTopMargin property gets or sets the heigh of the top margin. The unit of measurement depends on the value of the exDisplayInch property:

  • If exDisplayInch is set to 0, the value is measured in thousandths of an inch.
  • If exDisplayInch is set to 1, the value is measured in millimeters.

This setting defines the amount of space between the top edge of the paper and the start of the printable content. For example, a value of 1500 corresponds to a 1.5-inch top margin when using thousandths of inches.

For instance:

  • Settings(exTopMargin) = 1000, sets the top margin to 1.0 inch (if exDisplayInch is 0).

(long expression)

exRightMargin8

The exRightMargin property gets or sets the width of the right margin. The unit of measurement is determined by the value of the exDisplayInch property:

  • If exDisplayInch is set to 0, the value is interpreted as thousandths of an inch.
  • If exDisplayInch is set to 1, the value is interpreted in millimeters.

This setting provides control over the right margin of the printed page. For example, a value of 1500 specifies a right margin of 1.5 inches when using thousandths of inches as the unit.

For instance:

  • Settings(exRightMargin) = 2000, sets the right margin to 2.0 inches (when exDisplayInch is 0).

(long expression)

exBottomMargin9

The exBottomMargin property gets or sets the height of the bottom margin. The unit of measurement is determined by the exDisplayInch property:

  • If exDisplayInch is 0, the value is expressed in thousandths of an inch.
  • If exDisplayInch is 1, the value is expressed in millimeters.

This setting defines the distance between the bottom edge of the paper and the end of the printable area. For example, a value of 2000 indicates a 2.0-inch bottom margin when using thousandths of inches.

For instance:

  • Settings(exBottomMargin) = 2000, sets the bottom margin to 2.0 inch (if exDisplayInch is 0).

(long expression)

exDisplayInch10

The exDisplayInch property determines the unit of measurement used for margins and paper size in the print dialog. It must be set before any other printing-related settings, or it will have no effect. By default, the value is 0, which means measurements are specified in thousandths of inches. If set to 1, measurements are specified in millimeters. 

Valid values include:

  • 0, measurements are in inches (default)
  • 1, measurements are in millimeters (mm)

For instance:

  • Settings(exDisplayInch) = 1, configures the unit of measurement to millimeters instead of inches

(long expression)

exFormName11

The exFormName property gets the name of the paper form or size that the printer should use. You can use the exPaperSize property to configure the size of the paper on which the document will be printed. This value is a string that must match a form name supported by the printer driver, such as "A4", "Letter", or a custom-defined form.

  • it is used to select the exact dimensions and layout of the paper.
  • the name must correspond to a recognized paper form installed on the system or supported by the printer.
  • if an invalid or unrecognized form name is provided, the printer might revert to its default form or fail to print.
  • custom forms can be created through the printer settings in the operating system and must be available before assigning their names through this property.

(string expression)

exPaperWidth12 The exPaperWidth property defines the total width of the paper. The unit of measurement is determined by the exDisplayInch property:
  • If exDisplayInch is 0, the value is expressed in thousandths of an inch.
  • If exDisplayInch is 1, the value is expressed in millimeters.

To find out the width of the printable area within the page margins, use the ClientWidth property.

(long expression)

exPaperHeight13 The exPaperHeight property defines the total height of the paper. The unit of measurement is determined by the exDisplayInch property:
  • If exDisplayInch is 0, the value is expressed in thousandths of an inch.
  • If exDisplayInch is 1, the value is expressed in millimeters.

The ClientHeight property provides the height of the printable area on the page.

(long expression)

exAllFields256

The exAllFields property allows you to get or set the values for all printer-related settings at once. By using the Settings(exAllFields) property, you can save the current configuration of the printer, including paper size, orientation, margins, and other options, and later restore these exact settings. This makes it easier to manage printer configurations without handling each setting individually, ensuring consistency when printing across different sessions or documents.

The exAllFields property may return a string similar to:

"DisplayInch = 0
PaperSize = 9
PaperSource = 15
PageOrientation = 2
PrinterName = Xerox WorkCentre 3025
PrinterCopies = 1
PrintQuality = 600
LeftMargin = 2000
TopMargin = 1000
RightMargin = 1000
BottomMargin = 1000
FormName = A4
PaperWidth = 11692
PaperHeight = 8267"

(string expression)