ZPL II Software Integrator Guide for Kiosk Printers with ZebraDesigner™ P1026208-001 Rev.
© 2010 ZIH Corp. . The copyrights in this manual and the software and/or firmware in the printer described therein are owned by ZIH Corp. and Zebra’s licensors. Unauthorized reproduction of this manual or the software and/or firmware in the printer may result in imprisonment of up to one year and fines of up to $10,000 (17 U.S.C.506). Copyright violators may be subject to civil liability.
Contents 1 • Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Who Should Use This Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How This Document Is Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Contents Before Designing the Receipt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Auto Selected Print Widths for the KR403 Printer . . . . . . . . . . . . . . . 19 ZPL Kiosk Printer Supported Black and White (B/W) Graphics Formats 19 Zebra Designer Supported Graphics Formats . . . . . . . . . . . . . . . . . 19 Designing the Prototype Receipt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Start with a new (blank) receipt . . . . . . . . . . . . . . . . . . . . .
Contents The ZPL Format (Receipt Form or Template) . . . . . . . . . . . . . . . . . . . . . ZPL Format Structure Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . Printer Memory Management and Related Status Reporting . . . . . . ZPL Printer Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . Placing Objects in the Image Map . . . . . . . . . . . . . . . . . . . . . . . . . . Inputting Various Data into ZPL Code and the Printer . . . . . . . . . . .
4 Contents Bar Code Readability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bars are too light (underburn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overburn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spots or voids present in the image . . . . . . . . . . . . . . . . . . . . . . . . Unable to sustain wide/narrow ratio . . . . . . . . . . . . . . . . . . . . . . . . Bar Code Adjustments to Adjust Quality . . . .
1 Introduction Who Should Use This Document This software integrator’s programming guide for ZPL kiosk printers is for programmers who are familiar working with programming languages. How This Document Is Organized This guide is set up as follows: Section Description Introduction Proves an overview to the quick start to ZPL programming for ZPL kiosk printers and the tools and other items available for use.
2 Introduction How This Document Is Organized Section Description Setting Printer Behaviors This section describes how to use ZebraDesigner Windows driver to set and controls for most kiosk printer behaviors when printing, presenting, retracting and cutting the receipt. See the kiosk printer’s Hardware Integrators Guide for a complete description of the unique printer behaviors your printer is capable of performing.
Introduction Contacts Contacts Technical Support via the Internet is available 24 hours per day, 365 days per year. Web Site: www.zebra.com E-mail Back Technical Library: E-mail address: emb@zebra.com Subject line: Emaillist Self Service Knowledge Base: www.zebra.com/knowledgebase Online Case Registration: www.zebra.
4 Introduction Document Conventions Document Conventions The following conventions are used throughout this document to convey certain information. Alternate Color Cross-references contain hyperlinks to other sections in this guide. If you are viewing this guide electronically, you can click the cross-reference (blue text) to jump directly to its location. Command Line Examples Command line examples appear in Courier New font.
Introduction Overview Overview The Zebra KR403 printer is the first Zebra kiosk printer to use the powerful Zebra ZPL II (Zebra Programming Language). Zebra brand label and receipt printers typically use ZPL II as the native programming language for formatting and controlling print operations. The Zebra kiosk printer, like other Zebra printers, includes additional programming languages such as SGD (Set-Get-Do) printer control language or the ZBI 2.
6 Introduction Overview Zebra Setup Utility (ZSU) — ZSU installs the Windows driver and integrates a printer installation wizard. ZSU printer configuration tool. Zebra Designer (ZD) Windows Driver — The ZD Windows driver allows Windows applications to print directly to the printer and configure the printer behaviors and settings. The driver also includes a variety of features to aid the developer, such as, command line programming, kiosk settings, printer configuration export and import, etc.
Introduction ZPL Programming Development Process ZPL Programming Development Process The Zebra printers, applications and utilities support rapid integration of ZPL programming code into your kiosk applications and system. By using the Zebra Designer suite, printer documentation and utilities; printer receipts and controls can be coded by the Zebra Designer application for copying or use as pre-programmed ZPL command files.
8 Introduction Get Updated Software and Documentation Get Updated Software and Documentation It is recommended that you always get the latest software, firmware and documentation available at the start of your software development process. Save these files for future reference and system support. Go to the Zebra Web site at www.zebra.com.
Introduction Text Editors Text Editors Many word processors or text editors are capable of creating ASCII files that can be used to create ZPL printer programming files. However, for other encodings such as Unicode, a robust editor to mix the ASCII and raw data needed to support multiple character encoding methods. A useful tool to find and insert individual characters or glyphs into text is the Character Map tool.
10 Introduction Text Editors P1026208-001 Rev.
2 Development System Development System Setup Process Overview The process outlined below is a high level view of the steps needed to setup the development test system. It assumes that you have reviewed the kiosk printer’s Hardware Installation guide to familiarize you with the printer’s operation and systems requirements to operate properly.
12 Development System Setup the Development System Hardware Setup the Development System Hardware Programming the ZPL kiosk printer requires a basic familiarity with the kiosk printer to develop ZPL code and code snippets that can be used in the kiosk’s application software. Ideally the kiosk printer has been installed and mounted in a Windows based kiosk system as it will be used. The Hardware Integrator Guide was used as reference and the printer is loaded with media and ready to print.
Development System Setup the Development System Hardware Verify the Printer’s Model Name and Firmware Version Use the printed Printer Configuration Receipt to verify the printer’s model name and firmware versions: Hardware (H/W) which is also know as Boot-block and ZPL Firmware (F/W).
14 Development System Setup the Development System Hardware 3. With the ZDdownloader (Firmware Downloader) open and the printer connected to the PC, select the Printer pull-down menu and chose Auto-detect. Once the printer has been detected, it will show up in the printers list. If the serial port is being used, the PC’s serial port must be configured to allow proper communication first. See the Serial Communications in the Operations section of the Hardware Integrator Guide for more details. 4.
Development System Setup the Development System Hardware Verify Zebra Designer Suite and Printer Utilities Operation Each program should be run to verify that they have installed correctly. Print a Windows test print during the installation process or run the application and print a receipt. The printer should be recognized by the application. Install Swiss 721 Font and Project Selected Fonts in the PC Go to the Windows® Control Panel window and open Fonts. Copy the Swiss 721 TrueType font (tt0003m_.
16 Development System Setup the Development System Hardware P1026208-001 Rev.
3 Prototype Receipt Zebra Designer Overview Zebra Designer has many features in common with other Windows based graphics and page layout programs. • ZD has a WYSIWYG display of receipt/label. • It supports Text with Windows system and Zebra printer resident fonts. Text controls include font size, bold, italics and underline (if they are supported by the selected font set), as well as, text left, right and center justification.
18 Prototype Receipt Before Designing the Receipt • Time and Date - RTC (Real Time Clock) option • Serialized Data (counters) should not normally be used. The count is stored in DRAM and is lost when the printer is reset, power is lost, or by other printer control commands that clear temporary memory. • Prompted user data input. This is ZPL feature typically is used with a wedge device (Zebra KDU, bar code scanner, keyboard, keypad, etc.) via a standard Zebra printer’s serial port.
Prototype Receipt Before Designing the Receipt • Fonts and Language Support: Install identified fonts in the development system for access by Zebra Designer. The client or project requirements may define font type (sans or sans serif), language, region, and encoding method (Unicode, code page, double byte fonts, etc.) for text. Collect the identified fonts in the project archive with the documentation, software, etc. for later.
20 Prototype Receipt Before Designing the Receipt File extension Graphics type TIFF, TIF, FAX, G3N, G3F TIFF Bitmap PNG Portable Network Graphics WMF Windows Metafile EMF Enhanced Windows Metafile ICO Windows Icon CUR Windows Cursor TGA, TARGA, VDA, ICB, VST, PIX Targa Bitmap PXM, PPM, PGM, PBM Portable Pixmap, GreyMap, BitMap JP2 JPEG2000 J2K, JPC JPEG2000 Code Stream PCX Paintbrush Zebra Designer imports and converts the graphic file data into a B/W bitmap format.
Prototype Receipt Designing the Prototype Receipt Designing the Prototype Receipt New Receipt: Printer Properties Select your media (Stocks) Set Receipt/Label Options - Paper Format (mm -recommended) - Set Media Width and Length only Begin Designing Prototype Receipt using Zebra Designer Import Graphic using Picture Tool - Position Graphic on Receipt - Right Click -Select Properties - See ‘Fit’ pull-down menu in upper right corner to scale graphic Import Logo Graphics First Test Logo Print Quality Fai
22 Prototype Receipt Designing the Prototype Receipt Later, as you have become more familiar with Zebra Designer and the details associated with implementing the various receipt objects (bar codes, graphics, fonts and localized text), you can easily adjust this process to meet your needs and personal preferences. If your design includes multiple receipts with different receipt designs, then each design should be created as separate prototype receipt.
Prototype Receipt Designing the Prototype Receipt Prep Store Object Area in Printer If your printer has had prior use, there maybe stored objects in your development printer. Use the printer Tools>>Printer Configuration fly-out menu at the top of the ZDesiger window to access memory management tools for Stored Formats, Graphics and Downloaded Fonts. Delete all un-needed objects to maximize available printer memory.
24 Prototype Receipt Designing the Prototype Receipt • • TrueType fonts have a blue 'TT' symbol text (like most Windows programs). • Printer resident fonts have a red 'T' with a printer as a symbol. Text objects in the receipt layout using printer resident fonts have the 'Printer Resident' icon and have the word 'Zebra' proceeding the font letter, number or name.
Prototype Receipt Designing the Prototype Receipt Figure 3-3 • Placing a Logo 7. Place the graphic and scale to fit your design concept by grabbing the graphics corner handles. Avoid distorting the image specially if you are using bitmap graphics. Vector graphics can be distorted with reducing the image quality, but visually the customers eye may notice the altered shape. 8. Repeat this process as necessary for all logo graphics. 9. Global Setting for Logo Graphics processing: Add Bar Code(s) 1.
26 Prototype Receipt Designing the Prototype Receipt 5. Click Finish. Note some other bar codes are more complicated and may include additional ‘Bar Code Wizard’ screens to completely configure the bar code parameters. The bar code is now displayed in a ‘picket fence orientation’ in the receipt layout. 6. Click on the bar code and move to the desired location. 7. Click on the bar code and right click. Select ‘Bar Code Properties’. Figure 3-4 • Bar Code Properties 8.
Prototype Receipt Designing the Prototype Receipt 1. Lines and Filled Rectangles: Click on the Line tool in the left side tool bar. Place the mouse pointer where you want a line to start and click and drag it to the desired length and release. Lines will only draw in 90 degree increments (0. 90,180, 270 degrees). Diagonal lines can be added later when your design has been completed (less the diagonal lines) by hard coding them with ZPL. 2.
28 Prototype Receipt Designing the Prototype Receipt Aligning Objects With the desired objects selected, click on the appropriate Alignment tool icon in the right side tool bar (or right click and select Align). Ctrl-Z will undo the change. Rotating Objects With the desired objects selected, click on the appropriate Rotation tool icon (a circular dotted line arrow) in the right side tool bar. Ctrl-Z will undo the change.
Prototype Receipt Designing the Prototype Receipt Reviewing and Optimizing Your Prototype Receipt Design To finalize the receipt’s prototype, here is a quick check list of areas that can be optimized (here within ZDesigner). These design suggestions will help conserve printer memory, speed data transfer and printing, and help you convert your ZDesigner receipt to a ZPL application delivered receipt. • Reduce the number of fonts and font sizes where possible.
30 Prototype Receipt Designing the Prototype Receipt P1026208-001 Rev.
4 Setting Printer Behaviors Overview The ZebraDesigner Windows driver (hereinafter referred to as “driver”) is the primary method used to make printer configuration changes to the prototype receipt in development. The driver interacts with the ZebraDesigner (ZD) application to print receipts. ZebraDesigner provides an optional printing method - print to file. The print file is ZPL code that can be sent to the development printer or another similarly configured printer to recreate that prototype receipt.
32 Setting Printer Behaviors Printer Settings - Tools Tab Windows Driver Limitations The Windows driver for Zebra kiosk printers supports the most common printer behaviors. All commands and printer configurations are not supported. This driver only supports kiosk printer media handling which is set by the ^MMK - see the Print Mode command in the ZPL Programmers manual for your kiosk printer for more details.
Setting Printer Behaviors Printer Settings - Options Tab Once the printer has been set to Black Mark/Line media mode (^MNM), the printer needs to be calibrated to the black mark/line media installed in the printer. Use the Action-Calibrate Media Tools selection and Send. The printer will now measure the media. • If you are using the printer in one of the two non-kiosk modes, Rewind (^MMR) or Cutter (^MMC) Modes, then the printer needs to be re-configured.
34 Setting Printer Behaviors Printer Settings - Options Tab Command Name Description ^PO Print Orientation Flips print image 180 degrees. Check this box for printing in vertical mounting orientations. ^PW Print Width Sets width of image from Label (Receipt) Home ^LL Label Length Sets the length of the physical receipt. The minimum receipt length is 70 mm The printer in Black Mark/Line mode ignores this setting but ZebraDesigner uses this value.
Setting Printer Behaviors Printer Settings - Options Tab The illustrations below show the effects of the settings made with the driver’s Options page with basic receipt types - Continuous and Mark (black mark or line). Figure 4-3 • Print Image Placement When the print margin is adjusted via the Top and Left Options page settings (^LH30,30), the Right and Bottom settings on this page only adjust the setting within the ZebraDesigner page layout.
36 Setting Printer Behaviors Printer Settings - Advanced Setup Tab Printer Settings - Advanced Setup Tab This tab in the driver controls basic ZPL media handling behaviors for ZPL printers. ^MN ^LR ^PM ^LT ~TA ^LS Figure 4-4 • Advanced Setup Tab Command ^MN Name Media Tracking Description Specifies media type. Selects between Mark, Continuous (fixed) and Variable (continuous). The KR403 printer does not support Web Sensing used with non-marked label media. Web not supported.
Setting Printer Behaviors Printer Settings - Advanced Setup Tab - Other Settings Printer Settings - Advanced Setup Tab - Other Settings This window in the ZD Windows driver controls the non-kiosk printing post printing behavior settings for batch printing. Backfeed and Pause are primarily used in Tear-Off (peel/dispense) not supported by kiosk printers. Recommended Setting: Check the ‘Use Printer Settings...’ box and ignore this window.
38 Setting Printer Behaviors Printer Settings - Advanced Setup Tab - Kiosk Settings Printer Settings - Advanced Setup Tab - Kiosk Settings This tab in the ZD Windows driver control the label’s print area, including print speed and darkness settings. It can be accessed from ZebraDesigner by opening the ‘File’ pull-down menu and selecting ‘Printer Settings ...
Setting Printer Behaviors Printer Settings - Advanced Setup Tab - Kiosk Settings ^XA~JSB^MMK^MNV^JUS^XZ ^XA ^KV0,9,0,0,400 Imaging Parameters Here ^CN1 ~PL000 ^PN0 cut] [End receipt format and print] ^XZ Current Page New Page [Set and Save - Backfeed Before, Kiosk Mode, Variable Length (continuous] (Only send once to set basic configuration) [Start receipt format] [Kiosk Values command set to default] [At minimum, one object is required in the image to print.
40 Setting Printer Behaviors Printer Settings - Advanced Setup Tab - Kiosk Settings Hold Eject Partial - 10mm ^KV10,9,0,0,400 FAILS 3 pages Add: ^PQ3 Prints and jams with ^LL560 (70mm). Loop folds at partial cuts. Add Format: ^XA^CN1^PN0^XZ Hold Eject Partial - 10mm ^KV10,9,0,0,0 3 pages Add: ^PQ3 Prints 3 Pages with partial cuts between, No Loop, Full Cut after last receipt and Presents media. Next Print: Ejects media, then prints. Add Format: ^XA^CN1^PN0^XZ P1026208-001 Rev.
Setting Printer Behaviors Printer Settings – Command Fonts Tab Printer Settings – Command Fonts Tab Command fonts were introduced to improve direct control over the printer. Using command fonts enable the integrator to send printer code directly to a ZPL printer from a document or ZebraDesigner receipt file. One example is this enables the use of a specific font or bar code style stored in printer memory to be used in the receipt.
42 Setting Printer Behaviors Printer Settings – Command Fonts Tab The command font will show in the font list of the current program. For addition information, refer to the Driver Help file. P1026208-001 Rev.
Setting Printer Behaviors Printer Orientation Overview Printer Orientation Overview The horizontal printer mounting orientation is the factory default configuration. This windows driver or the Set/Get/Do command device.orientation must be used. Go to the Tools tab of this windows driver to change the orientation. See "Printer Settings Tools Tab" on page 32. Or send a ASCII text file to the printer with the following one of two lines of code. • Horizontal: ! U1 setvar “device.
44 Setting Printer Behaviors Printer Orientation Overview Figure 4-8 • Vertical Mounting Orientation Table 4-1 • Printer Orientation Number Description 1 Media In 2 Printline 3 Cutter 4 Presenter Loop Distance 5 Media Out 6 50mm minimum present 7 ^PN - Present Now (additional present length) 8 ~PL - Present Length Addition (additional present length to compensate for kiosk wall thickness) 9 Media Retract P1026208-001 Rev.
Setting Printer Behaviors Printer Orientation Overview When the printed media exits the printer and is presented to the kiosk user, the printout will appear upside-down. To change the orientation, use this windows driver. Go to the "Printer Settings - Options Tab" on page 33 and check the Rotate Orientation 180° in the Paper Format section of the window. Optionally, you can send the printer a ^PO - Print Orientation as a format (form).
46 Setting Printer Behaviors Convert ZebraDesigner Prototype Receipts to ZPL Code Paper Feed Direction Receipt Home (0,0) Rotation Image Print Area Leading Edge Receipt Length Cut Margin Max. Default Print Width Figure 4-9 • Receipt Image Map Margins Convert ZebraDesigner Prototype Receipts to ZPL Code After you are satisfied with your prototype receipts layout and printer behaviors, it is time to convert your ZebraDesigner label into ZPL code.
Setting Printer Behaviors Convert ZebraDesigner Prototype Receipts to ZPL Code The next step is to open ZebraDesigner and print the prototype receipt to a file. Note the location of the ^XA and ^MMK for following pages. Figure 4-10 • Prototype Receipt as ZPL Code The ZPL code is displayed in a text editor with word-wrap turned on. The following pages will have the word -wrap feature turns off. 10/29/2010 Software Integrator Guide P1026208-001 Rev.
48 Setting Printer Behaviors Convert ZebraDesigner Prototype Receipts to ZPL Code Figure 4-11 • ZebraDesigner ZPL Code File’s Functional Areas 1 Restores command prefixes and delimiters to default values. 2 Sets printer configuration parameters in a format (form). Note the ^XA and ^XZ. For more information, refer to "ZPL Basics" on page 49. 3 Download Objects - Fonts and Graphics Shown: Graphic download code (~DG) command string and the encoded graphics data on the following line.
5 ZPL Basics Overview ZPL is designed to provide simple, flexible commands that can be generated with common, basic PC programs. ZPL command files can be sent quickly and processed by most host systems using typical operating system commands (i.e. DOS COPY command) or develop applications (using other host to device communication methods). Because of this, your application’s ZPL code and your kiosk printers are easily maintained.
50 ZPL Basics The ZPL Command • Format commands use the caret (^) prefix. An “RS” (HEX 1E) can be substituted for the (^). From within ZPL command parameters, the caret (^) is treated as an ordinary ASCII character like any other character you would type in from the keyboard. • Control commands use the tilde (~) prefix. A “DLE” (HEX 10) can be substituted for the (~).
ZPL Basics The ZPL Command ZPL Command Structure Command structure basics: • A ZPL command consists of two (2) characters proceeded by a tilde (~) or caret (^) character. The ^ A command (Scalable/Bitmap Font) is the only exception to the two (2) command character rule at the time of this guides release. • Many ZPL commands have one or more parameter strings associated with them. Changing the value of one or more of these parameters affects the outcome of the printed label.
52 ZPL Basics The ZPL Command If the default value for a command parameter suits your application, you need not specify that parameter. However, parameters are “position-specific.” If you want to change just the third parameter, for example, you must indicate that it is the third parameter that you want to change. To do so, use a comma, the ZPL delimiter character, to mark each parameter’s place (i.e. ^AA,,60).
ZPL Basics The ZPL Command Format (^- Caret) Command Format commands form a template of a receipt (or label). These commands provide instructions to define the receipt (or label’s) layout and handling. • Physical properties: length, width, media type, etc. • Object placement: origin, orientation, reference point etc. • Type of object: simple graphic, logo graphic, text, and bar code, • Text and data: font selection, locale, character sets, variables, data encoding etc.
54 ZPL Basics The ZPL Format (Receipt Form or Template) The ZPL Format (Receipt Form or Template) The ZPL format (form) is the basic building block used to control and print with your Zebra kiosk printer. It can be used to simply print a receipt or in contrast, recall and process a sequence of stored formats (forms) in the printer, all from a single format (form). Formats can be created (and reused) to do common or repeated functions to the printer: e.g.
ZPL Basics The ZPL Format (Receipt Form or Template) A secondary benefit of organizing your ZPL format code will be improving the readability of the code to isolate functional groups and common behaviors for simplifying code. When creating multiple receipts formats, common elements can be isolated visually and with common text file compare tools available with many text or code editors. ^XA – Start format command. 1. 2. 3. 4. 5. 6. 7. ^XZ Download and recall of stored formats and graphics.
56 ZPL Basics The ZPL Format (Receipt Form or Template) Table 5-3 • ZPL Commands and Configuration Receipt Callout Cross-Reference Command Name Description ^KV Kiosk Values Sets Present and Cut print interactions ~JS Change Backfeed Sequence Adjusts rest point of cut edge of continuous media and interacts with the ^KV Cut Margin 3c ^PW Print Width Sets width of image from Label (Receipt) Home ^LL Label Length Sets the length of the physical receipt 4 ^PO Print Orientation Flips print imag
ZPL Basics The ZPL Format (Receipt Form or Template) The commands listed in this table can be part of the commands generated by ZebraDesigner or will be used as part of the most common receipts or developmental receipt formats covered in this guide. All non-persistent parameters set in this type of receipt format are cleared after printing the receipt. This includes print quantity, counters, variables, and the image map to name a few.
58 ZPL Basics The ZPL Format (Receipt Form or Template) Sensor settings used for service purposes. Figure 5-7 • Configuration Receipt Printout Table 5-4 • ZPL Commands and Configuration Receipt Callout Cross-Reference Command P1026208-001 Rev. B Listing Name Description ~SD DARKNESS Default: 20.0 for kiosk printers ^PR PRINT SPEED Default: 6 IPS / 152.4 mm/s (max.
ZPL Basics The ZPL Format (Receipt Form or Template) Table 5-4 • ZPL Commands and Configuration Receipt Callout Cross-Reference Command Listing Name Description CUT MARGIN Default: 009 (9 mm Range:2-9) ^KV,,c PRESENT TYPE Default: EJECT (0) ^KV,,,,e LOOP LENGTH Default: 400 (400 mm Range: 3- 1023 mm) SGD CMD ORIENTATION Default: HORIZONTAL MEDIA TYPE Default: VARIABLE LENGTH — SENSOR TYPE MARK (The KR403 only has mark sensing) — SENSOR SELECT MANUAL (^MNM must be set to calibrate to bl
60 ZPL Basics The ZPL Format (Receipt Form or Template) The configuration settings listed here resume after the TAKE LABEL sensor value. These listings contain printer feature seldom changed from default or provide status information (e.g. Firmware Version).
ZPL Basics The ZPL Format (Receipt Form or Template) Printer Memory Management and Related Status Reporting To help you manage printer resources, the printer supports a variety format commands to manage memory, transfer objects (between memory areas, import and export), object naming, and provide various printer operating status reports. They are very similar to the old DOS commands like DIR (directory listing) and DEL (delete file). ^XA – Start format command.
62 ZPL Basics The ZPL Format (Receipt Form or Template) • Allows use of ‘wild cards’ (*) in file access Table 5-6 • Object Management and Status Report Commands Command Name Description ^WD Print Directory Label Prints a list of objects and resident bar codes and fonts in all addressable memory locations ~WC Print Configuration Label Prints a configuration Status Receipt (Label) Same as Feed Button mode one flash routine ^ID Object Delete Deletes objects from printer memory ^TO Transfer Obj
ZPL Basics The ZPL Format (Receipt Form or Template) Placing Objects in the Image Map Objects get placed into the image map by a few simple methods. • Recall Format (^XF) and Image Load (^IL) place objects directly into the image map without referencing location within the image map. • The Field Origin (^FO) command is used to place objects in the image map and start the ‘field definition’. It references object placement from the top left corner of the object. The object is then described (e.g.
64 ZPL Basics The ZPL Format (Receipt Form or Template) P1026208-001 Rev. B • ZPL also supports file compression. See the ZPL Programmers guide’s ‘ZB64 Encoding and Compression’ appendix for details of encoding using common industry standard such as MIME Base64 and LZ77 (algorithm is used by the PKWARE® compression program PKZIP™).
6 Learning ZPL Overview The section has exercises designed to get you to explore, recognise functions and structure, and quickly transition to coding with ZPL. The exercises start by having you modify simple ZPL code of common tasks needed to modify your prototype receipt design. The exercises progress to how to modify, simplify, and re-use ZPL code. The later exercises in this chapter become more of a series of tutorials on how to modify the coding examples of typical kiosk printer usage scenarios.
66 Learning ZPL An Example of a Basic Receipt 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.
Learning ZPL Basic ZPL Exercises and Examples Basic ZPL Exercises and Examples The purpose of these exercises is to introduce basic ZPL commands to novice ZPL users. Make sure this checklist is complete: • Load the printer with continuous roll media that matches the media guide that is installed on the printer. • Restore the printer’s default settings using Load factory defaults and then Choose Action - Reset Printer. • Also from the Tools tab, Choose Print - Print configuration receipt (label).
68 Learning ZPL Basic ZPL Exercises and Examples Sending ZPL Files to the Printer Use the Windows driver from the Tools tab. Choose Action - Send Files. Optionally you can also use ZebraNet Bridge or ZDownloader (Firmware and File downloader. If you are using the serial interface, DOS copy commands will also work. Exercise 1 • This exercise shows you how to specify a location for an entered name. 1. Print your name on the receipt. 2. Start by printing just your name on the receipt.
Learning ZPL Basic ZPL Exercises and Examples Exercise 2 • This exercise shows you how to print a configuration status printout. 1. Send this format to the printer: ~WC This control (~) command causes the printer to print a Printer Configuration Label (receipt) immediately. Control commands do not need the ^XA and ^XZ start and end format (form) commands to execute. 1 2. Save this printout for the next exercise. Exercise 3 • This exercise shows you how to save a new printer configuration setting. 1.
70 Learning ZPL Basic ZPL Exercises and Examples Exercise 4 • This exercise shows you how to print a directory listing of memory locations. 1. Send this format to the printer: ^XA ^WDE:*.GRF ^XZ 1 Every format starts with the ^XA command 2 ^WD (Print Directory Label) command 3 Specifies E: memory and all GRF graphic file types in printed listing. Always use capitals for filenames.
Learning ZPL Basic ZPL Exercises and Examples Exercise 5 • This exercise shows you how transfer files to new memory locations. 1. Send this format to the printer: ^XA ^TOR:*.GRF,E: ^XZ 1 Every format starts with the ^XA command 2 ^WD (Print Directory Label) command 3 Specifies R: (RAM) memory and all GRF graphic file types to be moved to E: memory. The file name and extension are omitted to keep the same file names. Change a file name by entering the full file name and extension.
72 Learning ZPL Basic ZPL Exercises and Examples Exercise 6 • This exercise shows you the differences in object location commands. 1. Send this format to the printer: ^XA ^FT50,50,^ADN,36,20^FDZEBRA ^FS ^CN1 ^PN0 ^XZ 1 ^XA (Start Format) command 2 ^FT (Field Typeset) command 3 ^A (Scalable/Bitmap Font) command 4 ^FD (Field Data) command 5 ^FS (Field Separator) command 6 ^CN (Cut Now) command 7 ^PN (Present Now) 8 ^XZ (End Format) command 2.
Learning ZPL Basic ZPL Exercises and Examples Exercise 7 • This exercise shows you how to rotate text on the receipt. 1. Send this format to the printer: ^XA ^FO150,150,^ADN,36,20^FDZEBRA ^FS ^CN1 ^PN0 ^XZ 1 ^XA (Start Format) command 2 ^FO (Field Origin) 3 ^A (Scalable/Bitmap Font) command 4 ^FD (Field Data) command 5 ^FS (Field Separator) command 6 ^CN (Cut Now) command 7 ^PN (Present Now) 8 ^XZ (End Format) command Rotation parameter of the ^ A command 2.
74 Learning ZPL Basic ZPL Exercises and Examples Exercise 8 • This exercise shows you how to change fonts for the text on the receipt. 1. Send this format to the printer: ^XA ^FO150,150 ^ADN,36,20 ^FDZEBRA ^FS ^CN1 ^PN0 ^XZ 1 ^XA (Start Format) command 2 ^FO (Field Origin) 3 ^A (Scalable/Bitmap Font) command 4 ^FD (Field Data) command 5 ^FS (Field Separator) command 6 ^CN (Cut Now) command 7 ^PN (Present Now) 8 ^XZ (End Format) command Rotation parameter of the ^ A command 2.
Learning ZPL Basic ZPL Exercises and Examples Exercise 9 • This exercise shows you how to change font size of bitmap fonts. 1. Send this format to the printer: ^XA ^FO150,150 ^AAN,27,15 ^FDZEBRA ^FS ^FO130,150 ^GB4,27,2^FS ^CN1 ^PN0 ^XZ 1 ^XA (Start Format) command 2 ^FO (Field Origin) command 3 ^A (Font) commands. The A font is a 9x5 dot font.
76 Learning ZPL Basic ZPL Exercises and Examples Exercise 10 • This exercise shows you how to change font size of scalable fonts. 1. Send this format to the printer: ^XA ^FO150,150 ^A0N,27,15 ^FDG g Y y ^FS ^FO130,150 ^GB4,27,2^FS ^CN1 ^PN0 ^XZ 1 ^XA (Start Format) command 2 ^FO (Field Origin) command 3 ^A (Font) commands. The 0 (zero) resident scalable font is called.
Learning ZPL Basic ZPL Exercises and Examples Exercise 11 • This exercise shows you how to import an object (font or graphic) using ZPL. This exercise works for all supported file types and includes graphics the other typical object (file data type) that you may import into your kiosk printer. 1. Open the Font folder (located under Control Panels). Verify that the Verdana font is there, and drag it to your working directory. The font un-installs. Drag the font back to the Windows Font folder.
78 Learning ZPL Basic ZPL Exercises and Examples Exercise 12 • This exercise shows you how to delete a file (object) from memory. Completing the previous exercise is a prerequisite to starting this exercise. 1. Send this format to the printer: ^XA ^IDE:VERDANA.TTE ^XZ 1 ^XA (Start Format) command 2 ^ID (Print Directory Label) command 3 File memory location and file/object name.
Learning ZPL Basic ZPL Exercises and Examples Exercise 14 • This exercise shows you the how to simplify calling imported fonts. You will need two imported font installed in the kiosk printer for this exercise. Refer to Exercise 11 • on page 77 to install fonts as necessary. This exercise will use the Verdana font and the Zebra Swiss 721 font (pre-installed in the factory and it is a listed item to download from the Zebra Web site for development purposes). 1.
80 Learning ZPL Basic ZPL Exercises and Examples Exercise 15 • This exercise shows how to rename imported fonts for use with ^A command. You will need one imported font installed in the kiosk printer for this exercise. Refer to Exercise 11 • on page 77 to install fonts as necessary. This exercise will use the Verdana font. The All Directory Listing from Exercise 4 was used to determine available font alphanumeric characters to assign to the Verdana font. 1.
Learning ZPL Basic ZPL Exercises and Examples Exercise 16 • This exercise shows how to save a font alias. You will need one imported font installed in the kiosk printer for this exercise. Refer to Exercise 11 • on page 77 to install fonts as necessary. This exercise will use the Verdana font. The All Directory Listing from Exercise 4 was use to determine available font alphanumeric characters to assign to the Verdana font as an alias. 1.
82 Learning ZPL Basic ZPL Exercises and Examples Exercise 17 • This exercise shows how to change the default font to simplify formats. The printer’s default font is printer resident Font A (smallest resident bitmap font). The ^CF (Change Alphanumeric Default Font) command can change the default font and/or set the size of the default font. 1.
Learning ZPL Basic ZPL Exercises and Examples Exercise 18 • This exercise shows how to change default font setting within a format. The default font can be changed multiple times within a format (form). Please note the text location and the order 1.
84 Learning ZPL Basic ZPL Exercises and Examples Exercise 19 • This exercise shows how to group text to take advantage of using default fonts. This shows how the use of ^CF (Change Alphanumeric Default Font) command and grouping text that use the same font setting to print text. 1.
Learning ZPL Basic ZPL Exercises and Examples Exercise 20 • This exercise shows how Text (^A) and Field Orientation (^FW) interact. This exercise shows that the ^A Font selection command rotation parameter overrides the global setting of the ^FW command. In this exercises example code below, notice the first format (form) has a change to media tracking (^MNV default changes to ^MNN) and the cut margin on the leading edge is reduced to 2 mm (^KV0,9 default values are changed to ^KV0,2), 1.
86 Learning ZPL Basic ZPL Exercises and Examples Exercise 21 • This exercise shows the interaction of global rotation with object rotation. Individual rotation parameters override global rotation parameters of the ^FW command for text as show in this example, as well as, bar code objects. 1.
Learning ZPL Basic ZPL Exercises and Examples Exercise 22 • This exercise shows Image Map interactions with ^FO and ^FT placed text. Placing text objects that extend into the TOP or LEFT sides of the Image Map causes text to be distorted. 1.
88 Learning ZPL Basic ZPL Exercises and Examples Exercise 23 • This exercise shows how the use multiple Fonts with a single line of text. This shows how to use the ^FT (Field Typeset) command to concatenate a sequence of text data entries (Field Data, text, Field Separator). The ^FT without parameters separates each text entry. Separate font settings can be applied after each ^FT command. This can be used to apply bold, italic or other font variations.
Learning ZPL Basic ZPL Exercises and Examples Exercise 24 • This exercise shows how the ^TB command paragraph is placed to print. The ^TB (Text Block) command is used to printer paragraph text with line wrapping to the next line. It supports the advanced text handling capabilities of the Global Printing engine in you ZPL kiosk printer and Unicode. 1.
90 Learning ZPL Basic ZPL Exercises and Examples Exercise 25 • This exercise shows how the Text Block (^TB) rotates. Rotating the Text Block is different than rotating Single Line text data. The examples below have the text blocks rotated 90 degrees. The Text Block rotates 90 degrees and anchors to a different corner. 1.
Learning ZPL Basic ZPL Exercises and Examples Exercise 26 • This exercise shows how to add Line Feed/Carriage Return to a Text Block. The Global Printing engine of the ZPL kiosk printer only recognizes Unicode text handling characters or Hexadecimal command to do a Line Feed (0Ah) or a Carriage Return (0Dh). 1.
92 Learning ZPL Basic ZPL Exercises and Examples Exercise 27 • This exercise shows how a Text Block works in Continuous-Variable mode. The printer recognizes and prints objects that are placed in the image map and extends the end of the image to print all objects beyond the original end of format (form). The example shows that the text characters in the text block are the objects and not the text block itself. 1.
Learning ZPL Basic ZPL Exercises and Examples Exercise 28 • This exercise shows how Objects work in Continuous-Variable mode. The printer recognizes and prints objects that are placed in the image map and extends the end of the image to print all objects beyond the original end of format (form). The example shows that a graphic object (black or white line graphic) that extends or is placed beyond the preset receipt length will cause the image map to grow to accommodate the object plus 1 mm image margin.
94 Learning ZPL Basic ZPL Exercises and Examples Exercise 29 • This exercise shows how store and recall formats. Placing the ^DF (Download Format) command at the beginning of a format will store the rest of the format (form) as command text strings for recall with the ^XG (Recall Format) command. One or multiple formats (forms) can be recalled to print 1. Send this format to the printer: ZPL II CODE ^XA ^DFE:CONFIG-01.ZPL ^MNN ^KV0,2 ^LL560 ^XZ ^XA ^DFE:CONTENT-01.
Learning ZPL Basic ZPL Exercises and Examples Exercise 30 • This exercise shows how store a format as a graphic and recall it as a graphic. Format objects can be converted from text command strings to a graphic for fast recall where time is critical (typically less than a second) with the ^IS (.Image Save) command. The stored graphic of the layout can be brought into the image map in place with the ^IL (Image Load) command. 1.
96 Learning ZPL Basic ZPL Exercises and Examples Exercise 31 • This exercise shows how the use Text Data Variables in a format. Using text variables requires that you create two files. One, a format (form) with blank variable field data fields. The second format recalls the first format and supplies the blank text data fields with variable referenced data for each variable field in the recalled form.
7 Graphics Bitmap Graphics and Logos The ZPL kiosk printer only supports black and white bitmap graphics. Black and white bitmaps are the simplest type of computer based graphic. Most graphics that you will import for use in receipts will require some modification before they can be imported and printed. Earlier while using ZebraDesigner, you may have imported graphics in your prototype receipt designs. These were converted by ZebraDesigner into ZPL black and white bitmaps (GRF).
98 Graphics Bitmap Graphics and Logos • 203 dpi (dots per inch) / 8 dots per millimeter resolution • The image must be scaled and rotated to fit the area defined by the receipt design. By using common bitmap editing tools such as Photoshop®, Photo-Paint® or even Windows® Paint; picture and logo graphics can be imported into your kiosk printer. Several Zebra utilities and applications are available to help you import, convert and modify your graphics for use with ZPL programming.
Graphics Bitmap Graphics and Logos ZPL Graphics Commands Command ^FX Name Comment Description Places simple non-printing comment between ^FX and the next caret (^) or tilde (~) command. Graphic Call Commands ^XG Recall Graphic Recalls a stored bitmap graphic image and includes image magnification parameters. ^IL Image Load Places a stored graphic into the image map at the Label Home (^LH) position, the equivalent of ^FO0,0. ^IM Image Move Use the ^XG - Graphic Recall command instead.
100 Graphics Bitmap Graphics and Logos Command Name Description ~DY Download Objects Downloads and installs wide variety of printer usable programming objects: fonts (OpenType and TrueType) and graphics. ~DG Download Graphic Use the ^DY command for new ZPL code. Downloads an ASCII Hex representation of a graphic image. This is used by ZebraDesigner for graphics. Importing Graphics The ZPL programming language has multiple methods to download graphic objects into your Zebra ZPL kiosk printer.
Graphics Bitmap Graphics and Logos • • Choose B for BMP graphic formats. • Choose G for GRF graphic formats. • Choose X for PCX graphic formats. • Choose P for ZB64 converted PNG graphic formats. For the ~DY command’s t parameter (file size): • • Open the file’s properties in Windows by right clicking on the file to be imported. Copy the ‘Size in bytes’ (not ‘Size on disk’) to this parameter. Remove commas and periods from the byte count number you copied. For the ~DY command’s w parameter.
102 Graphics Bitmap Graphics and Logos • • Paintbrush (PCX) • ~DYE:Frog.PCX,B,X,1306,, • Frog.PCX file is appended or sent immediately following the ~DY command. • The PCX format is a legacy standard and no longer changes to meet today’s issues. Because of this, it is a good format for saving your graphics for import. PNG Format • Use the graphic import tools to convert and compress the PNG file. Using the PNG helps to minimize memory usage.
Graphics Bitmap Graphics and Logos • An ability to place multiple graphics with a ^FO or ^FT. This feature is only supported for text with the ^FT command. ZPL II CODE GENERATED LABEL ^XA ^LL560 ^FO50,50^XGE:SAMPLE.GRF,1,1^FS ^FO50,150^XGE:SAMPLE.GRF,3,3^FS ^FO50,250^XGE:SCREW1.BMP,1,1^FS ^FT250,350,1^XGE:FROG.PNG^FS ^FT050,550^XGE:FROG.
104 Graphics Line Graphics Line Graphics Zebra kiosk printer supports simple line graphics with four (4) commands. Those commands and commands that effect how they interact and displayed are listed in "Simple Line Graphics as Objects: Placement and Order" on page 105. Each of these commands features: • Height and width parameters (or for a circle an equivalent diameter parameter).
Graphics Line Graphics Note • ZebraDesigner does not support the Graphic Diagonal Line (or Graphic Circle). These must be added to receipt/label formats generated by the ZebraDesigner during the receipt modification development process. Note • Simple line graphics (and other printer objects and configuration formatting) can be saved as a Stored Format (form) or a Stored Graphic for later recall or reuse in other receipt formats (forms).
106 Graphics Line Graphics The ZPL programming example above shows how the rotation of a graphic can be simulated to be like the ^FO rotation of text (^A) objects around a single point (in this case - image map location 200,200). The third parameter of the Graphic Box/Line (^GBw,h,t), is set to half of the graphic boxes width or height, which ever is smallest o f the two.
Graphics Line Graphics The example below show how the diagonal line graphic can make lines with basic arrowheads and a few issues caused by using diagonal lines instead of the ^GB command to make a straight line.
108 Graphics Line Graphics The example below shows how the graphic box/line reacts to exceeding the image map boundaries. The printer has been changed to Continuous media mode from the default Variable -Length Continuous mode with a 2 mm cut margin to maximize the print area and lock the receipt size.
Graphics Line Graphics The example below shows how the box/line graphic (^GB) interacts with object order (layering), white and black graphics, and single object reverse print (^FR). The printer has been changed back to the default Variable-Length Continuous mode. Note how the graphic objects are placed beyond the minimum length of the receipt (^LL560).
110 Graphics Line Graphics The example below shows how the box/line graphic interacts with layering, white and black graphics, and single object reverse print (^FR) all interact with a global reverse print (^LR).
Graphics Line Graphics The Label Reverse Print is turned on and back off at the before the end of the receipt because the command ia precedent between receipts until turned off or a reset condition. This example shows how by placing a graphic box around all objects that all object are now printing reverse of the previous example printout.
112 Graphics Line Graphics P1026208-001 Rev.
8 Text and Fonts Overview The ZPL kiosk printer supports more than just text and fonts, it supports languages with the Zebra’s patented Global Printing Solution. The Global Printing Solution utilizes the advanced features of Unicode to support non-Latin script based languages with left to right, right to left, bi-directional, and top to bottom print with script dependent complex grammar and display rules.
114 Text and Fonts Overview Global Language Script Support A single script may support more than one language and a single language may use more than one script.
Text and Fonts Overview Supported Text Character Encoding Methods The printer uses the following programming selectable encoding methods to print receipts. See the Change International Font Encoding (^CI) command in the ZPL Programmers guide for your kiosk printer.
116 Text and Fonts Overview Windows operating systems since Windows 2000 have been running with UTF-16 as their internal encoding scheme. Most application development programs running in Windows however use UTF-8 as the text encoding scheme. UTF-8 has greater adoption and has fewer variations to encode data. It uses 8 bit chunks to encode text. UTF-16 uses 16 bit chunks of data. More environments can use the UTF-8 and is the preferred encoding format for more programs, applications, and web browsers.
Text and Fonts Overview See the Zebra Web site at www.zebra.com for additional fonts for your ZPL kiosk printer. Fonts are available in bitmap or scalable formats. Bitmap fonts take less memory and require the use of a DAT table for code page support. Bitmap characters look best when used at their default font size. Scalable fonts are supported by Unicode character mapping and typically one or more code pages. All sizes of the scalable font look good and are generated at time of printing.
118 Text and Fonts Overview Later, lower case letters were added to some resident font character sets in Zebra printers. The lower-case font characters, such as, ‘g’ or ‘y’ have descenders. A descender is the portion of the font character that extends below the font’s baseline. The font dot grid for this font becomes a 9 x 5 bitmapped font when upper and lower case fonts are combined.
Text and Fonts Overview Figure 8-2 • Magnifying Bitmap Font Size Today’s printer and computer applications primarily use scalable outline fonts such as TrueType and OpenType fonts for printing and display. Single fonts are scalable to any size supported by the application and equipment. Scalable outline fonts are built into the Windows operating systems and can be found in proportional and monospaced (or fixed) formats. Most of the scalable outline fonts are proportional.
120 Text and Fonts Overview Font scaling is based upon the height of the font character in dots. In the Windows application environment, font size is based upon a measurement called points. Font size in points is measured from the top of the highest ascender to its lowest descender in the entire font character/glyph set. A given font’s baseline is typically set to bottom of most upper case characters without a descender by the font designer.
Text and Fonts Overview Double-byte font encoding that does not use UTF-16, a Unicode based standard, may not support the advanced language features of the Global Printing system built into your ZPL kiosk printer. Your printer has several optional double-byte Asian fonts available for your ZLP kiosk printer.
122 Text and Fonts Overview Zebra Technologies Corporation - Font Licensing and Usage Warning Fonts that are converted and downloaded to Zebra printers remain the exclusive property of their specific owners and require license from such owners. By the act of downloaded font into a Zebra printer for use, you certify that you are in compliance with all licensing requirements set forth by such owners. Installing Fonts with ZPL Programming Your ZPL kiosk printer has several different font types.
Text and Fonts Overview ZPL Text Command Reference The following table provides a summary of kiosk printer commands that support printing text. Table 8-6 • ZPL Text Commands Command ^FX Name Comment Description Places simple non-printing comment between ^FX and the next caret (^) or tilde (~) command. Global or Persistent Commands ^FW Field Orientation Global default for all commands with orientation (rotation) and text justification parameters.
124 Text and Fonts Overview Table 8-6 • ZPL Text Commands Command Name Description ^FN Field Number Numbers data fields for later recall in a Stored Format (Form). See the ^DF (Store Format) and ^XF (Recall Format) commands for more details. ^FV Field Variable Used in place of the ^FD for variable data. ^SN Serialization Data Alphanumeric data counters for printing batches of receipts and labels for text and bar code data. ^FS Field Separator Marks the end of a data string for a text field.
Text and Fonts ZPL Basic and Global Text Printing Options Table 8-6 • ZPL Text Commands Command Name Description Font Download ~DY Download Objects Downloads and installs wide variety of printer usable programming objects: fonts (OpenType and TrueType), graphics, and other data object types not supported by the kiosk class printer.
126 Text and Fonts Designing for Multiple Language and Global Regions Single line (^FD,^FV,^SN and ^FP): Left to Right, Right to Left and Top to Bottom. Single line can support global printing. This Multi-Line (^FD, ^FV and ^FB): Left to Right, Right to Left, Centered, and Justified. Paragraph Text (^FD,^FV,^TB and ^PA): Justification: Auto, Left, Right, BiDi (bi-directional).
Text and Fonts Designing for Multiple Language and Global Regions Using the Windows Character Map Utility Windows® operating systems come with a Character Map utility to explore installed fonts for characters that are not mapped to keyboard keys. The utility allows you to select the data encoding method. Windows provides rough equivalent names to code pages support by the printer. It displays a character name and includes the one or more character encoding references.
128 Text and Fonts Designing for Multiple Language and Global Regions Language and Font Support ZPL Modeling Code Exercises The examples are arranged in order of simplest use of printer resources, simplest coding requirements, and using the most flexible methods for maintainability and expanding language support. Test text data on single line and text block data types. Adding characters with hexadecimal code Adding text strings with hexadecimal data only.
Text and Fonts Designing for Multiple Language and Global Regions Each line of text has English and another language in the Field Data (^FD). The English lets you know that the field prints and only the data that does not decode does not print. Note that the Chinese and Korean characters do not print but the Russian Cyrillic characters did print. Exercise 2 • This exercise shows how to add a non-printing placeholder character.
130 Text and Fonts Designing for Multiple Language and Global Regions Exercise 3 • This exercise shows how to access Swiss 721 font as an Alphanumeric Font. The ^CW (Font Identifier) is used to create an alphanumeric alias for the Swiss 721 Pan EMEA (TT0003M_ ) font. Use the new alphanumeric alias in the global font setting with ^CF (Change Alphanumeric Default Font) command. 1. Send this format to the printer: ZPL II CODE GENERATED LABEL ^XA ^CW1,E:TT0003M_.
Text and Fonts Designing for Multiple Language and Global Regions Exercise 4 • This exercise shows how to ‘Link’ the SimSun font to the Swiss 721 font. The ^CW (Font Identifier) is used to create an alphanumeric alias for the Swiss 721 Pan EMEA (TT0003M_ ) font. Use the new alphanumeric alias in the global font setting with ^CF (Change Alphanumeric Default Font) command. 1. Send this format to the printer: ZPL II CODE GENERATED LABEL ^XA ^CW1,E:TT0003M_.FNT ^CW2,B:SIMSUN.TTE ^FLB:SIMSUN.TTE,E:TT0003M_.
132 Text and Fonts Designing for Multiple Language and Global Regions Exercise 5 • This exercise shows how to ‘Link’ multiple fonts. The Arial Unicode font (ARIALUUNI) is added to the Swiss 721 font (TT0003M_) and its first linked font, SimSun. The Arial Unicode font contains the Chinese characters and the English characters of the primary font by does not print them. The Arial Unicode font only prints the Korean characters. The Korean characters are not part of the other two font sets. 1.
Text and Fonts Designing for Multiple Language and Global Regions Exercise 6 • This exercise shows how to remove font links. The previous exercise linked the same two (2) fonts twice to the Swiss 721 font. Use the ^FL (Font Linking) command. 1. Send this format to the printer: ZPL II CODE GENERATED LABEL ^XA ^LF ^XZ ^XA ^FLB:SIMSUN.TTE,E:TT0003M_.FNT,0 ^FLB:ARIALUNI.TTE,E:TT0003M_.FNT,0 ^JUS ^XZ ^XA ^LF ^XZ Second Receipt Out First Receipt Out 10/29/2010 Software Integrator Guide P1026208-001 Rev.
134 Text and Fonts Designing for Multiple Language and Global Regions P1026208-001 Rev.
9 Bar Codes For information on particular bar codes and programming bar code, see the ZPL Programmers guide for your kiosk printer model. Bar codes have ^B followed by an alphanumeric character to specify which bar code type is selected. See the ‘Fonts and Bar Codes’ section in the ZPL Programmers guide for general details about bar codes.
136 Bar Codes Bar Code Orientation • Support for the bar code • Resolution of the scanner • The data to be encoded must comply with the bar codes valid characters • Some bar codes require specified clearance around the bar code to properly read the bar code. Bar Code Orientation The bar code orientation with in a receipts design is an important consideration when programming your kiosk printer.
Bar Codes Bar Code Readability Spots or voids present in the image Spots and voids often correspond to dirt, abrasion or burned out elements on the printhead. Burned out elements prevent heat from transferring, resulting in dead spots on the label. Dirt or abrasives could also block or redirect the heat or ribbon transfer, resulting in voids or spots that could make the bar code unreadable.
138 Bar Codes Bar Code Readability Bar Code Adjustments to Adjust Quality Darkness: To adjust the burn temperature, darkness, or density (all names for the same control), use the ~SD (Set Darkness) control command. Speed: The printer’s default setting for the kiosk printer (KR403 at the time of this guides release) is 6 - (6 ips-150mm/s). Reducing the speed with the ^PR (Print Rate) command can improve quality, specially for ladder bar codes.
Bar Codes An Example of a Basic Receipt with Bar Codes Table 9-1 • ZPL Bar Code Commands Command Name Description ^FD Field Data Defines the start of a data string to print. ^FN Field Number Numbers data fields for later recall in a Stored Format (Form). See the ^DF (Store Format) and ^XF (Recall Format) commands for more details. ^FV Field Variable Used in place of the ^FD for variable data.
140 Bar Codes An Example of a Basic Receipt with Bar Codes ^BIN,,Y,N [^BI - Industrial 2 of 5 Bar Code: No rotation or picket fence orientation, includes human readable (print interpretation line) below the bar code.] ^FD1234567ABC^FS [^FD - Field data: Invalid data - contains Alpha characters. ^FS - Field Separator - needed to print.
Bar Codes An Example of a Basic Receipt with Bar Codes By changing the second bar code’s orientation parameter, we need to adjust the format’s settings for ladder style bar codes. The speed is reduced (^PR3) and the X module and the wide to narrow settings are adjusted (^BY3,3). The code validation is turned back on and the bar code data has been corrected to valid all characters.
142 Bar Codes An Example of a Basic Receipt with Bar Codes P1026208-001 Rev.
10 XML Overview XML-Enabled printing is a standard feature of the ZPL kiosk printer. Using XML to provide data to stored receipt formats in your printer requires little to no modification of your XML data files. The printer supports Unicode with UTF-8 and UTF-16 text encoding. Figure 10-1 • XML File Elements Example 10/29/2010 Software Integrator Guide P1026208-001 Rev.
144 XML Overview The corresponding ZPL receipt format could look like this: ZPL II CODE GENERATED LABEL ^XA ^DFE:XML-EXAM.ZPL^FS ^PA1,1,1,1 ^LL560 ^LH10,10 ^CI28 ^FT10,100,0 ^A@N,50,50,B:SIMSUN.TTE ^FN1^FDTestXMLField1^FS ^FT10,300,0 Figure 10-2 • XML Compatible Receipt Format The only difference between standard stored ZPL receipt format with variables and the XML compatible ZPL stored format is the inclusion of the ^FD and a variable name that corresponds to the XML variables in the XML data file.
11 KPL to ZPL Command Cross-Reference Overview The ZPL and KPL programming languages have different print processing methods. This section provides a rough equivalence of KPL to ZPL kiosk printer commands to aid in conversion of existing receipt code to the other programming language. ZPL is a Page mode printing process. KPL is a Line mode printing process. Both programming languages emulate some of the features inherent to the other printer’s fundamental print processing methodology.
146 KPL to ZPL Command Cross-Reference Overview Table 11-1 • KPL to ZPL Reference KPL Function ZPL Command Function Comments Command Enforced Clear Presenter EM n/a mechanical design specific to kiosk printers Clear Presenter ENQ n/a mechanical design specific to kiosk printers Acknowledge Marker ESC ACK n/a - see explanation below Select Font ESC ! Scalable/Bitm apped Font ^A or ^CW Font Identifier specify font to use in a text field Calibrate Blackmark Sensor ESC # Set Media Sensor
KPL to ZPL Command Cross-Reference Overview Table 11-1 • KPL to ZPL Reference KPL Function ZPL Command Function ESC B S Barcode Select & Field Origin Barcode Write ESC B W Barcode Field Instructions Make n Linefeeds ESC d Field Origin Status Enquiry Display ESC ENQ 001 Description Info Paper-nearend Enquiry ESC ENQ 002 Fonts and Logotype Enquiry Display ESC ENQ 004 Description Info Sensor Enquiry ESC ENQ 005 Status Report Firmwareversion Enquiry Barcode field Specify Comments Command ^
148 KPL to ZPL Command Cross-Reference Overview Table 11-1 • KPL to ZPL Reference KPL Function ZPL Command Function Comments Command Presenter loop ON/OFF max length ESC f n/a Eject (run presenter) ESC FF n/a Print Logotype ESC g Graphic Symbol ^GS ESC g - prints a customized logotype stored in the flash PROM Text Height ESC h Scalable/Bitm apped Font ^A h = character height defined in ZPL format string with specified font to use in a text field Italics ESC i n/a Paper Reverse ESC
KPL to ZPL Command Cross-Reference Overview Table 11-1 • KPL to ZPL Reference KPL Function ZPL Command Function Comments Command Print Text at XY ESC t Label Home ^LH Reversed/Inv ersed Text ESC T Field Reverse Print ^FR Underline ESC u Graphic Box can be used ^GB to create lines kiosk software can turn Underline on or off with single switch Text Width ESC w Scalable/Bitm apped Font ^A defined in ZPL format string with specified font to use in a text field Go to next Top of Form ESC Z
150 KPL to ZPL Command Cross-Reference Overview Table 11-1 • KPL to ZPL Reference KPL Function ZPL Command Function Comments Command Baud Rate 1 Set Serial communicatio ns ^SC Data bits 2 Set Serial communicatio ns ^SC Parity 3 Set Serial communicatio ns ^SC Flow Control 4 Set Serial communicatio ns ^SC Disable Parallel port signaling 5 n/a Burn time 7 Set Darkness ~SD Print Speed 8 Print Rate ^PR Presenter loop length 9 n/a Pause control 10 Programmabl e Pause ^PP or
KPL to ZPL Command Cross-Reference Overview Table 11-1 • KPL to ZPL Reference KPL Function ZPL Command Function Comments Command Black mark cut offset 41 & 42 n/a defines the paper feed between the black mark detection and cut Black mark top margin 43 & 44 n/a ZPL does not define black mark top margin Trash bin mode (Retract 45 function) n/a sets the function of the "retract and retain" function - specific to kiosk printers Wall 47 compensation n/a this parameter adds extra eject length sp
152 KPL to ZPL Command Cross-Reference Overview P1026208-001 Rev.