Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  


Sets a print setting.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 11.4 ❌ No ✅ Yes ❌ No ✅ Yes, on Windows ❌ No
MBS( "DynaPDF.Print.SetSetting"; Selector; Value )   More


Parameter Description Example
Selector What propert to set.
This includes PrinterName, Orientation, PaperSize, PaperLength, PaperWidth, Scale, Copies, DefaultSource, PrintQuality, Color, Duplex, YResolution, TTOption, Collate, FormName, MediaType, and DitherType.
Value The value to set.
Can be empty for most values to clear it.


Returns OK or error.


Sets a print setting.
Value can be empty (or -1) to clear value.

PrinterName: A text that specifies the "friendly" name of the printer or display; for example, "PCL/HP LaserJet" in the case of PCL/HP LaserJet. This string is unique among device drivers. Note that this name may be truncated to fit in the field. Can be overwritten via parameter to DynaPDF.Print!

Orientation: Value 1 is portrait and 2 is landscape.

PaperSize: Selects the size of the paper to print on. This member can be set to zero if the length and width of the paper are both set by the PaperLength and PaperWidth members. Otherwise, the PaperSize member can be set to a device specific value greater than or equal to DMPAPER_USER or to one of the following predefined values.

DMPAPER_LETTER1Letter 8 1/2 x 11 in
DMPAPER_LETTERSMALL2Letter Small 8 1/2 x 11 in
DMPAPER_TABLOID3Tabloid 11 x 17 in
DMPAPER_LEDGER4Ledger 17 x 11 in
DMPAPER_LEGAL5Legal 8 1/2 x 14 in
DMPAPER_STATEMENT6Statement 5 1/2 x 8 1/2 in
DMPAPER_EXECUTIVE7Executive 7 1/4 x 10 1/2 in
DMPAPER_A38A3 297 x 420 mm
DMPAPER_A49A4 210 x 297 mm
DMPAPER_A4SMALL10A4 Small 210 x 297 mm
DMPAPER_A511A5 148 x 210 mm
DMPAPER_B412B4 (JIS) 250 x 354
DMPAPER_B513B5 (JIS) 182 x 257 mm
DMPAPER_FOLIO14Folio 8 1/2 x 13 in
DMPAPER_QUARTO15Quarto 215 x 275 mm
DMPAPER_10X141610x14 in
DMPAPER_11X171711x17 in
DMPAPER_NOTE18Note 8 1/2 x 11 in
DMPAPER_ENV_919Envelope #9 3 7/8 x 8 7/8
DMPAPER_ENV_1020Envelope #10 4 1/8 x 9 1/2
DMPAPER_ENV_1121Envelope #11 4 1/2 x 10 3/8
DMPAPER_ENV_1222Envelope #12 4 \276 x 11
DMPAPER_ENV_1423Envelope #14 5 x 11 1/2
DMPAPER_CSHEET24C size sheet
DMPAPER_DSHEET25D size sheet
DMPAPER_ESHEET26E size sheet
DMPAPER_ENV_DL27Envelope DL 110 x 220mm
DMPAPER_ENV_C528Envelope C5 162 x 229 mm
DMPAPER_ENV_C329Envelope C3 324 x 458 mm
DMPAPER_ENV_C430Envelope C4 229 x 324 mm
DMPAPER_ENV_C631Envelope C6 114 x 162 mm
DMPAPER_ENV_C6532Envelope C65 114 x 229 mm
DMPAPER_ENV_B433Envelope B4 250 x 353 mm
DMPAPER_ENV_B534Envelope B5 176 x 250 mm
DMPAPER_ENV_B635Envelope B6 176 x 125 mm
DMPAPER_ENV_ITALY36Envelope 110 x 230 mm
DMPAPER_ENV_MONARCH37Envelope Monarch 3.875 x 7.5 in
DMPAPER_ENV_PERSONAL386 3/4 Envelope 3 5/8 x 6 1/2 in
DMPAPER_FANFOLD_US39US Std Fanfold 14 7/8 x 11 in
DMPAPER_FANFOLD_STD_GERMAN40German Std Fanfold 8 1/2 x 12 in
DMPAPER_FANFOLD_LGL_GERMAN41German Legal Fanfold 8 1/2 x 13 in
DMPAPER_ISO_B442B4 (ISO) 250 x 353 mm
DMPAPER_JAPANESE_POSTCARD43Japanese Postcard 100 x 148 mm
DMPAPER_9X11449 x 11 in
DMPAPER_10X114510 x 11 in
DMPAPER_15X114615 x 11 in
DMPAPER_ENV_INVITE47Envelope Invite 220 x 220 mm
DMPAPER_LETTER_EXTRA50Letter Extra 9 \275 x 12 in
DMPAPER_LEGAL_EXTRA51Legal Extra 9 \275 x 15 in
DMPAPER_TABLOID_EXTRA52Tabloid Extra 11.69 x 18 in
DMPAPER_A4_EXTRA53A4 Extra 9.27 x 12.69 in
DMPAPER_LETTER_TRANSVERSE54Letter Transverse 8 \275 x 11 in
DMPAPER_A4_TRANSVERSE55A4 Transverse 210 x 297 mm
DMPAPER_LETTER_EXTRA_TRANSVERSE56Letter Extra Transverse 9\275 x 12 in
DMPAPER_A_PLUS57SuperA/SuperA/A4 227 x 356 mm
DMPAPER_B_PLUS58SuperB/SuperB/A3 305 x 487 mm
DMPAPER_LETTER_PLUS59Letter Plus 8.5 x 12.69 in
DMPAPER_A4_PLUS60A4 Plus 210 x 330 mm
DMPAPER_A5_TRANSVERSE61A5 Transverse 148 x 210 mm
DMPAPER_B5_TRANSVERSE62B5 (JIS) Transverse 182 x 257 mm
DMPAPER_A3_EXTRA63A3 Extra 322 x 445 mm
DMPAPER_A5_EXTRA64A5 Extra 174 x 235 mm
DMPAPER_B5_EXTRA65B5 (ISO) Extra 201 x 276 mm
DMPAPER_A266A2 420 x 594 mm
DMPAPER_A3_TRANSVERSE67A3 Transverse 297 x 420 mm
DMPAPER_A3_EXTRA_TRANSVERSE68A3 Extra Transverse 322 x 445 mm
DMPAPER_DBL_JAPANESE_POSTCARD69Japanese Double Postcard 200 x 148 mm
DMPAPER_A670A6 105 x 148 mm
DMPAPER_JENV_KAKU271Japanese Envelope Kaku #2
DMPAPER_JENV_KAKU372Japanese Envelope Kaku #3
DMPAPER_JENV_CHOU373Japanese Envelope Chou #3
DMPAPER_JENV_CHOU474Japanese Envelope Chou #4
DMPAPER_LETTER_ROTATED75Letter Rotated 11 x 8 1/2 11 in
DMPAPER_A3_ROTATED76A3 Rotated 420 x 297 mm
DMPAPER_A4_ROTATED77A4 Rotated 297 x 210 mm
DMPAPER_A5_ROTATED78A5 Rotated 210 x 148 mm
DMPAPER_B4_JIS_ROTATED79B4 (JIS) Rotated 364 x 257 mm
DMPAPER_B5_JIS_ROTATED80B5 (JIS) Rotated 257 x 182 mm
DMPAPER_JAPANESE_POSTCARD_ROTATED81Japanese Postcard Rotated 148 x 100 mm
DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED82Double Japanese Postcard Rotated 148 x 200 mm
DMPAPER_A6_ROTATED83A6 Rotated 148 x 105 mm
DMPAPER_JENV_KAKU2_ROTATED84Japanese Envelope Kaku #2 Rotated
DMPAPER_JENV_KAKU3_ROTATED85Japanese Envelope Kaku #3 Rotated
DMPAPER_JENV_CHOU3_ROTATED86Japanese Envelope Chou #3 Rotated
DMPAPER_JENV_CHOU4_ROTATED87Japanese Envelope Chou #4 Rotated
DMPAPER_B6_JIS88B6 (JIS) 128 x 182 mm
DMPAPER_B6_JIS_ROTATED89B6 (JIS) Rotated 182 x 128 mm
DMPAPER_12X119012 x 11 in
DMPAPER_JENV_YOU491Japanese Envelope You #4
DMPAPER_JENV_YOU4_ROTATED92Japanese Envelope You #4 Rotated*/
DMPAPER_P16K93PRC 16K 146 x 215 mm
DMPAPER_P32K94PRC 32K 97 x 151 mm
DMPAPER_P32KBIG95PRC 32K(Big) 97 x 151 mm
DMPAPER_PENV_196PRC Envelope #1 102 x 165 mm
DMPAPER_PENV_297PRC Envelope #2 102 x 176 mm
DMPAPER_PENV_398PRC Envelope #3 125 x 176 mm
DMPAPER_PENV_499PRC Envelope #4 110 x 208 mm
DMPAPER_PENV_5100PRC Envelope #5 110 x 220 mm
DMPAPER_PENV_6101PRC Envelope #6 120 x 230 mm
DMPAPER_PENV_7102PRC Envelope #7 160 x 230 mm
DMPAPER_PENV_8103PRC Envelope #8 120 x 309 mm
DMPAPER_PENV_9104PRC Envelope #9 229 x 324 mm
DMPAPER_PENV_10105PRC Envelope #10 324 x 458 mm
DMPAPER_PENV_1_ROTATED109PRC Envelope #1 Rotated 165 x 102 mm
DMPAPER_PENV_2_ROTATED110PRC Envelope #2 Rotated 176 x 102 mm
DMPAPER_PENV_3_ROTATED111PRC Envelope #3 Rotated 176 x 125 mm
DMPAPER_PENV_4_ROTATED112PRC Envelope #4 Rotated 208 x 110 mm
DMPAPER_PENV_5_ROTATED113PRC Envelope #5 Rotated 220 x 110 mm
DMPAPER_PENV_6_ROTATED114PRC Envelope #6 Rotated 230 x 120 mm
DMPAPER_PENV_7_ROTATED115PRC Envelope #7 Rotated 230 x 160 mm
DMPAPER_PENV_8_ROTATED116PRC Envelope #8 Rotated 309 x 120 mm
DMPAPER_PENV_9_ROTATED117PRC Envelope #9 Rotated 324 x 229 mm
DMPAPER_PENV_10_ROTATED118PRC Envelope #10 Rotated 458 x 324 mm

PaperLength: overrides the length of the paper specified by the PaperSize member, either for custom paper sizes or for devices such as dot-matrix printers that can print on a page of arbitrary length. These values, along with all other values that specify a physical length, are in tenths of a millimeter.

PaperWidth: overrides the width of the paper specified by the PaperSize member.

Scale: Specifies the factor by which the printed output is to be scaled. The apparent page size is scaled from the physical page size by the given factor. For example, a letter-sized page with a Scale value of 0.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.

Copies: Selects the number of copies printed if the device supports multiple-page copies.

DefaultSource: Specifies the paper source.

DMBIN_UPPER1Select the upper paper bin. This value is also used for the paper source for printers that only have one paper bin.
DMBIN_LOWER2Select the lower bin.
DMBIN_MIDDLE3Select the middle paper bin.
DMBIN_MANUAL4Manually select the paper bin.
DMBIN_ENVELOPE5Select the auto envelope bin.
DMBIN_ENVMANUAL6Select the manual envelope bin.
DMBIN_AUTO7Auto-select the bin.
DMBIN_TRACTOR8Select the bin with the tractor paper.
DMBIN_SMALLFMT9Select the bin with the smaller paper format.
DMBIN_LARGEFMT10Select the bin with the larger paper format.
DMBIN_LARGECAPACITY11Select the bin with large capacity.
DMBIN_CASSETTE14Select the cassette bin.
DMBIN_FORMSOURCE15Select the bin with the required form.

PrintQuality: Specifies the printer resolution. The number of dots per inch (DPI) and is therefore device dependent.

Color: Switches between color and monochrome on color printers. The following are the possible values:

DMCOLOR_COLOR2Black & White only

Duplex: Selects duplex or double-sided printing for printers capable of duplex printing. Following are the possible values.

DMDUP_SIMPLEX1Normal (nonduplex) printing.
DMDUP_HORIZONTAL3Short-edge binding, that is, the long edge of the page is horizontal.
DMDUP_VERTICAL2Long-edge binding, that is, the long edge of the page is vertical.

YResolution: Specifies the y-resolution, in dots per inch, of the printer. If the printer initializes this member, the PrintQuality member specifies the x-resolution, in dots per inch, of the printer.

TTOption: Specifies how TrueType fonts should be printed. This member can be one of the following values.

DMTT_BITMAP1Prints TrueType fonts as graphics. This is the default action for dot-matrix printers.
DMTT_DOWNLOAD2Downloads TrueType fonts as soft fonts. This is the default action for Hewlett-Packard printers that use Printer Control Language (PCL).
DMTT_DOWNLOAD_OUTLINE4Downloads TrueType fonts as outline soft fonts.
DMTT_SUBDEV3Substitutes device fonts for TrueType fonts. This is the default action for PostScript printers.

Collate: Specifies whether collation should be used when printing multiple copies. (This member is ignored unless the printer driver indicates support for collation by setting the Fields member to include collate.) This member can be one of the following values.

DMCOLLATE_TRUE1Collate when printing multiple copies.
DMCOLLATE_FALSE0Do not collate when printing multiple copies.

FormName: A text that specifies the name of the form to use; for example, "Letter" or "Legal".

MediaType: Specifies the type of media being printed on. The member can be one of the following predefined values, or a driver-defined value greater than or equal to the value of DMMEDIA_USER.

DMMEDIA_GLOSSY3Glossy paper.
DMMEDIA_USER 256Device-specific media start here.

DitherType: Specifies how dithering is to be done. The member can be one of the following predefined values, or a driver-defined value greater than or equal to the value of DMDITHER_USER.

DMDITHER_NONE1No dithering.
DMDITHER_COARSE2Dithering with a coarse brush.
DMDITHER_FINE3Dithering with a fine brush.
DMDITHER_LINEART4Line art dithering, a special dithering method that produces well defined borders between black, white, and gray scaling. It is not suitable for images that include continuous graduations in intensity and hue, such as scanned photographs.
DMDITHER_GRAYSCALE10Device does gray scaling.
DMDITHER_USER256Device-specific dithers start here.

You can query values with DynaPDF.Print.GetSetting function.


Sets paper size to DIN A4:

MBS( "DynaPDF.Print.SetSetting"; "PaperSize"; 9 // A4 210 x 297 mm )

Sets paper size to US Letter:

MBS( "DynaPDF.Print.SetSetting"; "PaperSize"; 1 // US Letter 8 1/2 x 11 in )

Set printer paper size and orientation:

Set Variable [ $r ; Value: MBS( "DynaPDF.Print.SetSetting"; "PaperSize"; 9) // A4 210 x 297 mm ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Print.SetSetting"; "Orientation"; 1) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Print.SetSetting"; "PrinterName"; "Microsoft Print to PDF") ]
Set Variable [ $Flags ; Value: 16 ]
Set Variable [ $ShowDialog ; Value: 16 ]
Set Variable [ $r ; Value: MBS("DynaPDF.Print"; $pdf; ""; ""; ""; $Flags; ""; ""; ""; ""; $ShowDialog) ]

See also

Release notes

Blog Entries

Created 9th August 2021, last changed 10th August 2021

DynaPDF.Print.SetDevNames - DynaPDF.RGB

Feedback: Report problem or ask question.

MBS Xojo tutorial videos

Start Chat