Programmer's Guide User guide

Programmer’s Guide | 1
5 Thermal Printer Programmer’s Guide
The following:
<ESC>&l1O<ESC>&l2A <ESC>&l5.81C
can be combined into the following single escape sequence:
<ESC>&l1o2a5.81C
In the example above, the capital ‘O’ becomes a lower case ‘o’, the ‘A’ of the second
command becomes an ‘a’ and the ‘EC&l’ are dropped from the second and third
commands. The printer commands are performed in the order they are combined, from
left to right.
Barcode Clipping
PCL normally clips print objects at the dot level on the logical page boundary. Barcodes
clipped in this manner can easily go undetected. Because of this, any portion of a
barcode that falls beyond the boundaries of the logical print area will be dropped and a
shaded rectangle will be printed, inscribing the area within the logical print page where
the barcode would have been. This will provide visual evidence to the user the barcode
has been clipped and is therefore invalid.
Barcodes that are not generated internally by the printer will not be clipped in this
manner and may not be readable by scanning devices.
Cursor Positioning Commands
The PCL cursor refers to the Current Active Position (CAP) which identifies the current
position on the label where a print command begins laying out page data. The cursor can
be moved anywhere within the logical page using a combination of the horizontal and
vertical cursor position commands and control codes. Although there are many different
ways to move the cursor, there are three types of cursor positioning units. These include
PCL Units, Decipoints, and Row/Column units.
The size of a PCL unit is determined by the value specified by the Unit of Measure
command. The format of this command is <ESC>&u#D where # is the number of units
per inch. The “units per inch” value is a discrete value from the following set of values:
{96, 100, 120, 144, 150, 160, 180, 200, 225, 240, 288, 300, 360, 400, 450, 480, 600,
720, 800, 900, 1200, 1440, 1800, 2400, 3600, and 7200}. If the Unit of Measure is not
set, the default value is 300.
A decipoint, in PCL terminology, is 1/720 inch or one-tenth of a PCL point. A PCL point is
exactly 1/72 inch as opposed to a typographic point which is approximately 1/72 inch.
Decipoints are resolution independent. Labels that are designed using units of decipoints
will be resolution independent and are therefore easily portable across PCL printers of
different resolutions. This is the preferred unit of measure in label design.
Cursor Positioning after Printing Barcode
PCL has a procedure for cursor positioning after printing a text character. Set the Current
Active Position (CAP) to the right at a distance equal to the width of that character, ready