2017-07-11 29 views
3

Zebra Z410ラベルプリンタでペルシャ文字を印刷しようとしています。しかし何らかの理由でそれは??????を印刷しています。プリンタに送信するZPLコードは、UTF-8文字がZebraプリンタで印刷されない

^XA 
^FO50,50 
^PA1,1,1,1 
^[email protected],50,50,E:TT0003M_.TTF^FDعاسشاتعفثه^FS 
^XZ 

です。Zebraセットアップユーティリティ - プリンタとのオープン通信を使用しています。助けてください!!

enter image description here

+0

私の経験から、プリンタのほとんどは、出力に文字を使用する内部エンコーディングのを変更するためのセットアップ方法(ソフトウェアユーティリティまたはハードウェアボタン)のいくつかの種類があります。多くの場合、適切なエンコーディングが設定されていないと、プリンタは正しい文字を印刷できません。マニュアルを読んでください(おそらくユーザマニュアル以外のテクニカルマニュアルがあります)、エンコーディングとページファイルを探します。 –

答えて

1

上記のあなたの例では、^あなたはUTF-8の代わりに、磁界Hexを使用してみましょううCI28が指定されていませんでした。 N、50,50、E @

^XA

^FO50,50

^PA1,1,1,1

^A:TT0003M_.TTF^^ CI28 FDعاسشاتعفثه^ FS

^XZ

ゼブラセットアップユーティリティは、UTF-8を正しく処理していません。私はちょうどネットワークプリンタにPuTTYでテストし、UTFは適切に処理されました。 SDKには、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^[email protected],56,55,E:ANMDS.TTF^CI28^FH\^FN12"Customer Name"^FS 
// ^FT26,316^FH\^[email protected],56,55,E:ANMDS.TTF^FH\^FN11"Invoice Number"^FS 
// ^FT348,73^FH^[email protected],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(); 
    } 
} 

}

+0

ここで例を共有してください – ZAJ

関連する問題