我对 ZPL 很陌生,并尝试学习它。我写了一些用于打印标签的代码,但我得到了意想不到的结果。ZDesigner GX420d 打印机始终显示 1 inc 上边距。
这是我的 ZPL 代码:
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR3,3~SD8^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL0609
^LS0
^FT13,41^A0N,28,28^FH\^FDShip From :^FS
^FT13,75^A0N,28,28^FH\^FDAG Hair CosmZticsfwZfZwfwZfwZfwZ^FS
^FT13,109^A0N,28,28^FH\^FD8021 EntZrprisZ StrZZt^FS
^FT13,142^A0N,28,28^FH\^FDBurnaby, BC Canada V5A 1V5^FS
^FT12,216^A0N,28,28^FH\^FDINV#B32184^FS
^FT566,218^A0N,28,28^FH\^FDDZlivZry 11/8/2013^FS
^FT11,274^A0N,28,28^FH\^FDATTN : (ATTN)^FS
^FT590,273^A0N,28,28^FH\^FDCUST #(TYHA01)^FS
^FT10,348^A0N,28,28^FH\^FDShip To :^FS
^FT10,382^A0N,28,28^FH\^FDTY HAIR DESIGN^FS
^FT10,416^A0N,28,28^FH\^FD113-7320 KING GEORGE HWY^FS
^FT10,450^A0N,28,28^FH\^FDSURREY^FS
^FT738,530^A0N,28,28^FH\^FDCOD^FS
^FT11,528^A0N,28,28^FH\^FD( 1 OF 1) PiZcZs^FS
^PQ1,0,1,Y^XZ
我的输出是:
在 ZebraDesigner Pro 2 中:
我不明白发生了什么。
我挑衅地做错了什么,但不知道那里。
更新 :
我安装ZDesigner GX420d driver
并使用以下代码进行打印:
RawPrinterHelper.SendStringToPrinter("ZDesigner GX420d", command);
public static bool SendStringToPrinter(string szPrinterName, string szString)
{
IntPtr pBytes;
Int32 dwCount;
// How many characters are in the string?
dwCount = szString.Length;
// Assume that the printer is expecting ANSI text, and then convert
// the string to ANSI text.
pBytes = Marshal.StringToCoTaskMemAnsi(szString);
// Send the converted ANSI string to the printer.
SendBytesToPrinter(szPrinterName, pBytes, dwCount);
Marshal.FreeCoTaskMem(pBytes);
return true;
}
我使用RawPrinterHelper将 ZPL 发送到打印机。