1.2.1.4 Device Commands

The structures in the printer-data table contain device-command strings.
There are three formats that you can use to type command strings in
UniTool:

Format                Description
---------------------------------------------------------------------------

ASCII                 Literal ASCII characters can be typed as part of a
                      command string.

Formatted parameter   A formatted parameter is a parameter that is supplied
                      by the Universal Printer Driver, and sent to the
                      printer in a format based on the specified conversion
                      characters. These conversion characters are always
                      preceded by the % character. The following contains
                      the conversion characters which are supported by the
                      Universal Printer Driver, as well as a brief
                      description of each.

                      Character   Description
                      -----------------------------------------------------

                      d           The Universal Printer Driver will convert
                                  the parameter to a decimal value. (For
                                  example, the value 12 will be sent as '1'
                                  (31h) followed by '2' (32h).)

                      D           The Universal Printer Driver will convert
                                  the parameter to a signed decimal value.
                                  This is the same as the %d character
                                  except it is preceded by a sign.

                      c           The Universal Printer Driver will convert
                                  the parameter to a byte value. (For
                                  example, the value 12 will be sent as FF
                                  (0Ch))

                      l           The Universal Printer Driver will convert
                                  the parameter to a 16-bit value with the
                                  Least Significant Byte (LSB) first. (For
                                  example, the value 12 will be sent as FF
                                  (0Ch) followed by NULL (00h))

                      m           The Universal Printer Driver will convert
                                  the parameter to a 16-bit value with the
                                  Most Significant Byte (MSB) first. This
                                  is the same as %l except the order of the
                                  bytes is reversed.

                      q           The Universal Printer Driver will convert
                                  the parameter to a unique hexadecimal
                                  value formatted for Toshiba and Qume
                                  devices.

Hexadecimal           Hexadecimal values are preceded by the following two
                      characters: \x. For example, the hexadecimal value
                      0xFF would be typed as \xFF in UniTool.

There are two types of printer commands which you will type in UniTool. The
first type enables or disables certain features of the printer. For
example, the command string ESCx3 enables letter-quality output of the
Kodak Diconix 150 Plus printer. This command (ESCx3) is typed as \x1Bx\x03
in the Text Qualities dialog box. The string ESC was replaced by its ASCII
representation (\x1B), the argument x was not altered, and the decimal
value 3 was replaced by its hexadecimal equivalent (\x03). The second type
of command contains parameters that are supplied by the Universal Printer
Driver at runtime (when the command is used). For example, the Immediate
Line Feed command for the Diconix printer is used to advance the cursor in
the positive y-direction with respect to the current cursor position. The
command string for the Immediate Line Feed command has the following
syntax:

    ESC J n

In this example, n is the number of 1/288th inch increments that the cursor
will advance. The following illustration shows the Immediate Line Feed
command typed in the CM_OCD_YM_REL control of the CURSORMOVE dialog box:

bitmap:  crsrmv

The ESC string was again replaced by its ASCII representation (\x1B), the
argument J was not altered, and the variable n was replaced by the
conversion character indicating that it is a byte value (%c).