
Learning ZPL
An Example of a Basic Receipt
66
P1026208-001 Rev. B Software Integrator Guide 10/29/2010
An Example of a Basic Receipt
This exercise is designed to guide you through the basic steps to create a common receipt
which contains text and a bar code.
Type the programming instructions (shown in bold) in the order given. An explanation of
what each instruction does is in brackets [ ] or referenced in a table. A printed example of
the label is included with arrows pointing to the different parts as needed to illustrate the
make up of the receipt and an indication of the ZPL command that was used to create it.
^XA [^XA - Indicates start of format.]
^LH30,30 [^LH - Sets Label Home position 30 dots to the right
and
30 dots down from top edge of label.]
^FO20,10^AD^FDZEBRA^FS [^FO20,10 - Set field origin 20 dots to the right and
10 dots down from the home position defined by the
^LH instruction.]
[
^AD - Select font “D.”]
[
^FD - Start of field data.]
[ZEBRA - Actual field data.]
[
^FS - End of field data.]
^FO20,60^B3^FDAAA001^FS[^FO20,60 - Set field origin 20 dots to the right
and
60 dots down from the home position defined by
the
^LH instruction.]
[
^B3 - Select Code 39 bar code.]
[
^FD - Start of field data for the bar code.]
[AAA001 - Actual field data.]
[
^FS - End of field data.]
^CN0 [^CN0 - Cut Now (printer is in kiosk mode)]
^PN0 [^PN0 - Present Now (printer is in kiosk mode)]
^XZ [^XZ - Indicates end of format and print receipt.]
This receipt uses the out of box defaults. It needed ^CN0 and ^PN0 to present the receipt.
Kommentare zu diesen Handbüchern