Printing Chinese via ZPL code without using font

Hello everyone,

 

Could you please take a look on my problem?

 

I am trying to printing Unicode characters via ZPL code without using font.

I was successful with some Unicode language by using hex in ZPL code.

For example:

^XA

^CI28

^FO60,75

^ASN,36,20^FH^FD_46_6c_c3_bc_67_65_6c^XZ

Result: Flügel

 

However, when I try to print Chinese with the same way, nothing is printed to the printer.

This is my python code for printing:

 

#!/usr/bin/env python

# -*- coding: utf-8 -*-

#ZPL docs can be found at https://support.zebra.com/cpws/docs/zpl/zpl_manual.pdf

#This works with Python 2, change the str to bytes if you are using Python 3

import sys

import socket

import csv

import os

import pdb

import sys

import binascii

 

 

TCP_IP = '127.0.0.1'

TCP_PORT = 9100

BUFFER_SIZE = 4096

 

 

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

print s

s.connect((TCP_IP, TCP_PORT))

 

 

zpl = """^XA

 

 

^CI28

^FO60,75

^ASN,36,20^FH^FD"""

zpl = zpl + "_" + "_".join("{:02x}".format(ord(c)) for c in "传傳")

    #zpl = zpl + "_e7_8e_ab"

zpl = zpl + """^XZ"""

print zpl

s.send(str(zpl))

 

 

s.close()

 

Thanks in advance for any helps.

Anonymous (not verified)
Hi Kira,Are you using a

Hi Kira,

Are you using a printer built for the Chinese or Asian market?  If you don't know, please post the part number on the the bottom or back of the printer.

If the printer is not built for the Asian market, the built in fonts will not have the Chinese characters.  Some European characters are supported, but Chinese was too large a font for the limited memory on many of our older printers. 

You can add a font if the printer has enough memory.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Kira Raki
Dear Robin,Actually, I just

Dear Robin,

Actually, I just tested printing via http://labelary.com/viewer.html​ and saw that printing Chinese is not working there. That means that http://labelary.com/viewer.html doesn't support Chinese printing?

I'm going to test on real printer machine and this is printer info. Could you please take a look if it supports Asian market? Thanks much.

IMG_1755.JPG

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Unifaun Config
One additional question,

One additional question, which font are you installing for printers built for the Chinese and Asian market?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


ZOOU Qinn
Print Chinese fonts to Zebra ZPL printer from python

I have an issue similarly.

So far, I can print Chinese Characters correctly using "Zebra Setup Utilities" with ZPL commands below:

^XA
^CW1,E:SIMSUN.TTF
^SEE:GB18080.DAT^CI26
^FO200,10^A1N,36,20^FDEnglish汉字^FS
^XZ

I edited python code according the simple code on URL https://www.zebra.com/us/en/support-downloads/knowledge-articles/ait/Net...

# -*- coding: utf-8 -*-
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('168.168.183.199', 9100))
zpl = b'''
^XA
^CW1,E:SIMSUN.TTF
^SEE:GB18080.DAT^CI26
^FO200,10^A1N,36,20^FDEnglish汉字^FS
^XZ
'''
s.send(zpl)
s.close()

However, the Chinese characters on label is messy code as launching this script.

So, how to modifying this script?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments