5

I am trying to print Persian character on my Zebra Z410 label printer. But for some reason it is printing ?????. The ZPL code I am sending to the printer is

^XA
^FO50,50
^PA1,1,1,1
^A@N,50,50,E:TT0003M_.TTF^FDعاسشاتعفثه^FS
^XZ

I am using the Zebra Setup Utilities-Open communication with printer. Please Help!!

enter image description here

1
  • From my experience, most of the printers have some kind of setup way (software utility or hardware buttons) to change the internal encoding's that uses to output the characters. In many cases printers can't print the correct characters if they don't have the right encoding configured. Read the manual (maybe there is a technical manual other than user manual) and look for encoding's and page files. Commented Jul 16, 2017 at 8:27

1 Answer 1

4
+50

Your example above did not specify ^CI28 which would let you use UTF-8 instead of field hex.

^XA

^FO50,50

^PA1,1,1,1

^A@N,50,50,E:TT0003M_.TTF^CI28^FDعاسشاتعفثه^FS

^XZ

Zebra Setup Utilities is not handling the UTF-8 correctly. I just tested with PuTTY to a network printer and the UTF was handled properly. There are also examples in the SDK on how to print using UTF-8.

     // Print a stored format with the given variables. This ZPL will store a format on a printer,
 // for use with example3.
 // This example also requires the ANMDS.TTF font to have been download to the printer prior to using this code.
 // ^XA^DFE:FORMAT3.ZPL
 // ^FS
 // ^FT26,223^FH^A@N,56,55,E:ANMDS.TTF^CI28^FH\^FN12"Customer Name"^FS
 // ^FT26,316^FH\^A@N,56,55,E:ANMDS.TTF^FH\^FN11"Invoice Number"^FS
 // ^FT348,73^FH^A@N,39,38,E:ANMDS.TTF^FH\^FN13"Vendor Name^FS
 // ^BY2,4^FT643,376^B7N,4,0,2,2,N^FH\^FDSerial Number^FS
 // ^FO5,17^GB863,379,8^FS
 // ^XZ

 private void example3() throws ConnectionException {
     Connection connection = new TcpConnection("192.168.1.32", TcpConnection.DEFAULT_ZPL_TCP_PORT);
     try {
         connection.open();
         ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
         Map<Integer, String> vars = new HashMap<Integer, String>();
         vars.put(12, "东风伟世通汽车饰件系统有限公司"); // Customer Name
         vars.put(11, "订单号"); // Invoice Number
         vars.put(13, "供应商名称"); // Vendor Name
         printer.printStoredFormat("E:FORMAT3.ZPL", vars);
     } catch (ConnectionException e) {
         e.printStackTrace();
     } catch (ZebraPrinterLanguageUnknownException e) {
         e.printStackTrace();
     } finally {
         connection.close();
     }
 }

}

Sign up to request clarification or add additional context in comments.

1 Comment

can you please share the example here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.