Adr*_*fin 4 c# utf-8 epl zpl zebra-printers
我有这个用Zebra打印机打印的代码(RW 420具体)
StringBuilder sb = new StringBuilder();
sb.AppendLine("N");
sb.AppendLine("q609");
sb.AppendLine("Q203,26");
//set printer character set to win-1250
sb.AppendLine("I8,B,001");
sb.AppendLine("A50,50,0,2,1,1,N,\"za?ó?? g??l? ja??\"");
sb.AppendLine("P1");
printDialog1.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
if (printDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
byte[] bytes = Encoding.Unicode.GetBytes(sw.ToString());
bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1250), bytes);
int bCount = bytes.Length;
IntPtr ptr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(bCount);
System.Runtime.InteropServices.Marshal.Copy(bytes, 0, ptr, bytes.Length);
Common.RawPrinterHelper.SendBytesToPrinter(printDialog1.PrinterSettings.PrinterName, ptr, bCount);
}
Run Code Online (Sandbox Code Playgroud)
RawPrinterHelper是我从这里得到的微软课程.
我的问题是只打印ASCII字符,如下所示:
za g l ja
Run Code Online (Sandbox Code Playgroud)
缺少非ASCII字符.
有趣的是,当我打开记事本并将相同的文本放在那里并在Zebra打印机上打印时,所有字符都可以.