Set Printing Area Width

This command sets the width of the printing area. If the setting exceeds the printable area, the maximum value of the printable area is used.

ASCII

GS W nL nH

Hexadecimal

1D 57 nL nH

Decimal

29 87 nL nH

Range of nL

0–255

Range of nH

0–255

Default

80 mm width, 576 dots (the maximum printable area)

58 mm width, 424 dots (the maximum printable area)

The width of the printing area is set to (((nH X 256) + nL) times horizontal motion unit) inches. The horizontal motion units are set by the Set Horizontal and Vertical Minimum Motion Units command (1D 50). The width of the printing area follows the Set Left Margin command (1D 4C).

Note:  Refer to Set Left Margin for a description.

Formulas

To set the width of the printing area to one inch at the default horizontal motion unit of 1/203 inches, send the four-byte string:

GS W 203 0

Or, to set the width of the printing area to two inches at the default horizontal motion unit of 1/203 units per inch, send the four-byte string:

GS W 150 1

Where 2 inches = 406/203, and 406 = (1 X 256) + 150.

Example:   

MSComm1.Output = Chr$(&H1D) & Chr$(&H57) & Chr$(nL) & Chr$(nH)

Note:  This command is effective only at the beginning of a line. This command is ignored if the line buffer is not empty, and only affects the receipt interface. If the setting exceeds the printable area, the maximum value of the printable area is used. The maximum printable area is 576 dots for 80 mm paper width and 424 dots for 58 mm paper width. Refer to the illustration in the Set Left Margin command (1D 4C).