I'm trying to print a label from an Android app to a Zebra printer (iMZ 320) but it seems not to be understanding my command line.
When I try this sample code, the printer prints all the commands to the paper as I send them to the printer:
zebraPrinterConnection.write("^XA^FO50,50^ADN,36,20^FDHELLO^FS^XZ".getBytes());
I've read the ZPL programming tutorial from Zebra's official website, but I can't figure out how to make my printer work all right with ZPL commands.
The Zebra iMZ may ship in line print mode. This means that it will not parse and interpret the ZPL commands that you have provided, but rather, it will print them. You'll need to configure the printer to ZPL mode instead of line print mode. The following command should do it:
! U1 setvar "device.languages" "zpl"
Note: In some cases you may have to set the language to "hybrid_xml_zpl" instead of just "zpl"
Notice that you need to include a newline character (or carriage return) at the end of this command. You can use Zebra Setup Utilities to send commands directly to the printer through its 'communication' perspective, available by hitting the 'communication' button on the main screen.
Zebra Setup Utilities: http://www.zebra.com/us/en/products-services/software/manage-software/zebra-setup-utility.html
ZPL Manual page 705 (details command such as the one listed above): https://support.zebra.com/cpws/docs/zpl/zpl_manual.pdf