documentType

Type: Integer

The documentType property of the Printer class contains the printer form type; that is, the paper size. The default value is Print_A4.

You can change the documentType property dynamically, to allow allocation of the paper type to be used on a page-by-page basis.

Changing this property causes a newPage method to be executed before the documentType property is changed if the print is not at the start of a new page. Changing the documentType property also causes the pageHeight and pageWidth methods to return the appropriate values for the new paper type size.

Use the Printer class getDefaultDocumentType method to return the default document type that is set for the physical printer.

Use the Printer class setCustomPaperSize method to dynamically set a custom printer paper size at run time, using the specified width and height in units of a tenth of a millimeter (for example, call app.printer.setCustomPaperSize(2100, 2970); to set the paper size equivalent to A4). If you call printer.documentType to set Print_Custom_Paper, an exception is raised.

The Printer global constant category document (printer form) types are listed in the following table.

Global Constant Integer Value Description
Print_10X11 45 10 x 11 in
Print_10X14 16 10x14 inches
Print_11X17 17 11x17 inches
Print_15X11 46 15 x 11 in
Print_9X11 44 9 x 11 in
Print_A2 66 A2 420 x 594 mm
Print_A3 8 A3 297 x 420 mm
Print_A3_Extra 63 A3 Extra 322 x 445 mm
Print_A3_Extra_Transverse 68 A3 Extra Transverse
Print_A3_Transverse 67 A3 Transverse 297 x 420 mm
Print_A4 9 A4 210 x 297 mm
Print_A4Small 10 A4 Small 210 x 297 mm
Print_A4_Extra 53 A4 Extra 9.27 x 12.69 in
Print_A4_Plus 60 A4 Plus 210 x 330 mm
Print_A4_Transverse 55 A4 Transverse 210 x 297 mm
Print_A5 11 A5 148 x 210 mm
Print_A5_Extra 64 A5 Extra 174 x 235 mm
Print_A5_Transverse 61 A5 Transverse 148 x 210 mm
Print_A_Plus 57 SuperA - A4 227 x 356 mm
Print_B4 12 B4 250 x 354 mm
Print_B5 13 B5 182 x 257 mm
Print_B5_Extra 65 B5 (ISO) Extra 201 x 276 mm
Print_B5_Transverse 62 B5 (JIS) Transverse 182 x 257 mm
Print_B_Plus 58 SuperB - A3 305 x 487 mm
Print_CSheet 24 C size sheet
Print_Custom_Paper 256 Customized paper size
Print_DSheet 25 D size sheet
Print_ESheet 26 E size sheet
Print_Env_10 20 Envelope #10 4 1/8 x 9 1/2 inches
Print_Env_11 21 Envelope #11 4 1/2 x 10 3/8 inches
Print_Env_12 22 Envelope #12 4 3/4 x 11 inches
Print_Env_14 23 Envelope #14 5 x 11 1/2 inches
Print_Env_9 19 Envelope #9 3 7/8 x 8 7/8 inches
Print_Env_B4 33 Envelope B4 250 x 353 mm
Print_Env_B5 34 Envelope B5 176 x 250 mm
Print_Env_B6 35 Envelope B6 176 x 125 mm
Print_Env_C3 29 Envelope C3 324 x 458 mm
Print_Env_C4 30 Envelope C4 229 x 324 mm
Print_Env_C5 28 Envelope C5 162 x 229 mm
Print_Env_C6 31 Envelope C6 114 x 162 mm
Print_Env_C65 32 Envelope C65 114 x 229 mm
Print_Env_DL 27 Envelope DL 110 x 220 mm
Print_Env_Invite 47 Envelope Invite 220 x 220 mm
Print_Env_Italy 36 Envelope 110 x 230 mm
Print_Env_Monarch 37 Envelope Monarch 3.875 x 7.5 inches
Print_Env_Personal 38 6 3/4 Envelope 3 5/8 x 6 1/2 inches
Print_Executive 7 Executive 7 1/4 x 10 1/2 inches
Print_Fanfold_Lgl_German 41 German Legal Fanfold 8 1/2 x 13 inches
Print_Fanfold_Std_German 40 German Std Fanfold 8 1/2 x 12 inches
Print_Fanfold_US 39 US Std Fanfold 14 7/8 x 11 inches
Print_Folio 14 Folio 8 1/2 x 13 inches
Print_ISO_B4 42 B4 (ISO) 250 x 353 mm
Print_Japanese_PostCard 43 Japanese Postcard 100 x 148 mm
Print_LetterSmall 2 Letter Small 8 1/2 x 11 inches
Print_Ledger 4 Ledger 17 x 11 inches
Print_Legal 5 Legal 8 1/2 x 14 inches
Print_Legal_Extra 51 Legal Extra 9.275 x 15 in
Print_Letter 1 Letter 8 1/2 x 11 inches
Print_LetterSmall 2 Letter Small 8½ x 11 inches
Print_Letter_Extra 50 Letter Extra 9.275 x 12 in
Print_Letter_Extra_Transverse 56 Letter Extra Transverse 9.275 x 12 in
Print_Letter_Plus 59 Letter Plus 8.5 x 12.69 in
Print_Letter_Transverse 54 Letter Transverse 8.275 x 11 in
Print_Note 18 Note 8 1/2 x 11 inches
Print_Quarto 15 Quarto 215 x 275 mm
Print_Statement 6 Statement 5 1/2 x 8 1/2 inches
Print_Tabloid 3 Tabloid 11 x 17 inches
Print_Tabloid_Extra 52 Tabloid Extra 11.69 x 18 in

The code fragment in the following example shows the use of the documentType property.

// Specify the format of the pages to be printed.  As these default
// to Print_Portrait and Print_A4, you only need to redefine them
// if you require a different format.
app.printer.orientation  := app.printer.Print_Landscape;
app.printer.documentType := app.printer.Print_Letter;

For details about retaining the setting of this property when the printer is closed, see the Printer class retainCMDValues property.