Reading status from Zebra Printer

后端 未结 5 1052
日久生厌
日久生厌 2021-01-04 08:52

I\'m working on a project where we need to use a Zebra Printer for barcode labels. We\'re using C#, and we\'re doing OK on the printing side of things, sending raw ZPL stri

5条回答
  •  没有蜡笔的小新
    2021-01-04 09:06

    I'm facing the same problem. Did you already manage anything on this subject?

    Ax Perez Parra Castro, this is how I did it:

    -get the RawPrinterHelper class from here http://support.microsoft.com/kb/322091

    -my printer (zebra 2030) doesn't support ZPL, so as far as I know the only way is to send unicode to it

    -I made a list of characters I need e.g.

    string enq = Convert.ToChar(5).ToString();
    string esc = Convert.ToChar(27).ToString();
    string nul = Convert.ToChar(0).ToString();
    string rs = Convert.ToChar(30).ToString();
    string lf = Convert.ToChar(10).ToString();
    string cr = Convert.ToChar(13).ToString();
    

    (get those int values from en.wikipedia.org/wiki/ASCII)

    -compose the command - e.g. sb.Append(esc + enq + Convert.ToChar(7).ToString()); (from the printer manual, the command < ESC>< ENQ><7> should get the firmware version)

    -send the command RawPrinterHelper.SendStringToPrinter(printerName, sb.ToString()); (printerName in my case is "Zebra TTP 2030")

提交回复
热议问题