Duplex, Orientation, Zoom Properties (Printer)

Purpose

Return or set device mode properties Duplex, Orientation, and Zoom.

Syntax

Printer.Duplex [ = long ]
Printer.Orientation [ = long ]
Printer.Zoom [ = long ]

Description

The Duplex property returns or sets a value that determines whether a page is printed on both sides (if the printer supports this feature, if not Duplex returns 0).

1 (Simplex) - Single-sided printing with the current orientation setting.

2 (Horizontal) - Double-sided printing using a horizontal page turn.

3 (Vertical) - Double-sided printing using a vertical page turn.

The Orientation property returns or sets a value indicating whether documents are printed in portrait or landscape mode.

1 (Portrait) - Documents are printed with the top at the narrow side of the paper.

2 (Landscape) - Documents are printed with the top at the wide side of the paper.

The Zoom property returns or sets the percentage by which printed output is to be scaled up or down. The default is 0, which specifies that the printed page appears at its normal size. 50 means shrink the output to 50%.

Example

Ocx CommDlg cd

cd.Flags = 0

cd.ShowPageSetup

Set Printer = cd

Debug.Show

Trace Printer.Duplex

Trace Printer.Orientation

Trace Printer.Zoom

Remarks

The device mode properties Duplex, Orientation, and Zoom are in fact dm-properties, like dmCollate, dmPaperSize, etc. They could have been named dmDuplex, dmOrientation, and dmZoom, as well. However, for compatibility reasons (VB) they weren't.

Known Issues

[Fixed in UpdateRT v1.2] Setting the Orientation property can cause random bugs (mainly Divide by Zero) or cause the IDE or compiled executable to terminate prematurfely; this is due to the fixed buffer size orginally programmed into GFA-Basic which was not expandable and this not able to cater for changes made to the Windows Printer object over the years.
[Reported by James Gaite, 22/04/2022]

See Also

Printer, ShowPageSetup, ShowPrint, SetPrinterByName, dm-Properties

{Created by Sjouke Hamstra; Last updated: 09/05/2022 by James Gaite}