getting-started-with-zebra-printers-and-apps-app-note
getting-started-with-zebra-printers-and-apps-app-note
Target Audience
This document is for developers with little to no experience using Zebra printers or who need
to develop an app to print barcode labels, receipts, RFID tags, or other tracking labels.
Technical Requirements
The information in this Application Note assumes you have technical competence with core
programming concepts and rationales.
Note: It is recommended that you use a PC, because Zebra does not support all of the
resources required to set up and use Zebra printers on Macs.
Resources
This section contains useful resources for your development efforts.
Note: Some of these resource downloads ask for a login to www.zebra.com. It is free and
easy to register for a login – just follow the registration link.
Zebra Utilities
The Zebra Utilities app connects with a Zebra printer over Bluetooth or WLAN and sends it
labels and receipts. It is primarily used for testing connections or demoing printing capabilities
to customers. It is available for free on both Google Play and iTunes.
Most Zebra tabletop and desktop printers take a USB-B (Square) cable. Mobile printers
may take a USB-mini (Sony) or USB-micro (Android) cable depending on the model.
An icon appears on the lower right corner in the system tray signaling this setup.
If the printer does not appear in the “Printers” box, set the printer up manually by doing
the following:
The different versions represent the different printer control languages that the model of
the printer supports. If the listed printer has no language listed after it, then that version
uses its default printer language.
▪ ZPL stands for Zebra Printer Language. Zebra recommends you select this version,
because ZPL is updated and fixed continuously. Tabletop and Desktop Zebra printers
use this language by default.
▪ CPCL stands for Comtec Printer Control Language. Mobile Zebra printers use this
language as their default language.
▪ Click Next.
▪ Click Finish.
Note: For Macs, before plugging in your printer, make sure you download and install the
CUPS driver. You need this driver to properly configure your printer. For instruction
on how to connect a printer over USB to a Mac, see To Install or Add a Zebra Printer.
Connect Using a PC
1. Open Zebra Setup Utilities.
2. Highlight your printer and click Configure Printer Connectivity.
3. Select Bluetooth and click Next.
4. Ensure that Discoverable is on and that Enabled is checked. Set the Friendly Name to
something identifiable.
5. Click Finish.
3. Enter your printer commands in the top box. The input is in ZPL or another printer control
language, depending on which version of the driver you are using. After entering a
command, click Send To Printer. The bottom box displays what the printer returns as a
result. To test this, you can send “~HI” without quotes to see the basic printer information.
Note: Any commands beginning with a tilde (~) are immediate commands. The printer
processes these commands immediately. Other commands must start with “^XA”
and end with “^XZ”.
For Macs
For information on how to communicate with your printer using Zebra Setup Utilities for
OSX/Mac, watch this video. For help communicating with your printer using CUPS, refer to
Command Line Printing and Options.
To add an IP printer:
Later in the setup wizard, you can set the height and width of the label.
Now you have a blank label. Design your label using the tools on the left.
When the label is done, there are two ways of printing it:
Print Preview
Using Print Preview allows you to view and alter the printer code before actually sending it to
the printer.
1. In Zebra Designer, go to File > Print Preview.
2. Check Print to File.
3. Click Print.
4. Save your label’s code.
Export to Printer
Exporting the label to the printer stores the label in the printer’s internal storage.
To export to a printer,
1. In Zebra Designer, go to File > Export to Printer.
2. Select Internal Flash and click OK.
Note: This stores the label on the printer.
3. Open Zebra Setup Utilities or CUPS.
4. Send “^XA^XFE:” followed by what you named the label, followed by “.ZPL^FS^XZ” to the
printer.
Example: If the file was named Test, then “^XA^XFE:Test.ZPL^FS^XZ” makes the file
print.
Printer Webpage
Another option is to use the printer’s webpage to design and print a label. The Alternate for
Non-PC Users section contains instructions on how to access the page.
To print from the web page,
1. Click Directory Listing.
2. Click Create New Script.
3. Name the label and click Edit.
4. Enter the ZPL for the label.
For instructions on how to create a label using ZPL, refer to the ZPL Programming Guide
for Link-OS Enabled Printers pages 43-52.
Preview Label lets you see what the label will look like when it prints, and Print Label
prints the label. You may also save the ZPL for the label to the printer for future use.
Formats
ZebraDesigner also offers the capability to create label formats; that is, it can create a label
design with fields that you can alter and print with different values. Say you need to print
name tags for 30 people. You could create separate name tags for all 30 people, or you could
create one name tag format and just enter everyone’s name individually.
7. Select ZDesigner from the left column and the printer you are using from the right column.
8. Click Next twice.
9. Change the printer name to what you used in your file path. Using the file path above, the
printer name would be “ZPL File Output”.
10. Click Next twice.
11. Uncheck the Set as the default printer box and click Finish.
Using a Format
To learn how to create and implement a format in Zebra Designer, Store Label Format and
Recall for Printing using ZebraDesigner.
Android Studio
Android Studio is an IDE for creating Android apps. Click here for help getting started with
Android Studio and here for help getting started with the Zebra Android Link-OS SDK.
Term Description
Comtec Printer CPCL is another printing language, like ZPL. It accomplishes the same
Control Language thing, but the syntax is different.
(CPCL)
Direct Thermal Direct thermal printers require a special kind of paper. This paper is
coated with ink and an acid. When heated, the two melt and mix together
and become colored. A direct thermal printer heats tiny dots that trigger
this process and result in words and images.
Driver A program that runs in the background of a computer, allowing a
computer to communicate with a device or program. Drivers make it
easier for a computer to communicate with a printer or smartphone.
Firmware Firmware is low-level software permanently installed into computers,
printers, and other hardware devices. It provides basic control over the
device. While a device’s firmware can never be changed out, most can be
updated over time.
Integrated And IDE is a program, such as Android Studio or Visual Studio that
Development allows developers to write and test software. IDEs usually contain a text
Environment (IDE) editor, compiler, interpreter, and debugger.
Media Media is what the printer is printing on, such as a roll of paper or a roll of
labels.
Software Development An SDK is a set of tools to be used in applications. They enable
Kit (SDK) developers to use different aspects of a software package or device.
SDKs usually consist of libraries and supporting documentation.
Thermal printers use heat, not ink, to print. They either burn dots onto a
special coated paper or heat a ribbon to transfer wax-based ink onto
Thermal Printer regular paper. Zebra Technologies only produces thermal printers.
Thermal Transfer Thermal transfer printers use a ribbon coated in wax-based ink. The
printer melts this wax to transfer it from a ribbon onto paper. This type of
printing does not require any special paper, just occasional ribbon
replacements.
Zebra Printing ZPL is a language for communicating with Zebra printers. Printers cannot
Language (ZPL) process documents or regular programming languages, so when
something is sent to be printed, it must first be converted into ZPL or
some other printing language the printer understands.
See Also
• For any further information, sample code and solutions or to request further content,
visit the Zebra Developer Portal.
Disclaimer
All links and information provided within this document are correct at time of writing.
Created for Zebra Global ISV Program by Zebra Development Services.