Reading status from Zebra Printer

Posted by pmoreira on Stack Overflow See other posts from Stack Overflow or by pmoreira
Published on 2009-12-04T11:18:10Z Indexed on 2010/03/31 1:13 UTC
Read the original article Hit count: 623

Filed under:
|
|
|

Hi,

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 strings to the printer (using winspool.drv).

However, we also need to read from the printer, and no luck there.

We need to get the status from the printer, which is the output to the ZPL command "~HS", so we can tell how many labels are in memory waiting to be printed. The EnumJobs() from winspool.drv only has jobs on the windows spool, and once they're sent to the printer, they're gone from that list. But that doesn't mean the label has been printed, since the printer has a peel sensor and only prints one label at a time, and we're obviously interested in sending batches of labels to the printer.

I've tried something like (using the winspool.drv calls):

OpenPrinter(szPrinterName, out hPrinter, IntPtr.Zero);
WritePrinter(hPrinter, pBytes, dwCount, out dwWritten); // send the string "~HS"
ReadPrinter(hPrinter, data, buff, out pcRead);

But I get nothing on the ReadPrinter call. I don't even know if this is the right way of going at it.

Anyone out there tackled this before?

Thanks.

© Stack Overflow or respective owner

Related posts about zpl-ii

  • ZPL II Extended Characters

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I'm trying to print extended code page 850 characters using ZPL II to a Zebra S4M. Whenever one of the extended characters I.E. ASCII value 127 is used I get a box of varying shades of grey instead of the actual value. I'm trying to print ± and ° (ALT+0177 and ALT+0176). I suspect its the RawPrinterHelper… >>> More

  • Reading status from Zebra Printer

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Hi, 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 strings to the printer (using winspool.drv). However, we also need to read from the printer, and no luck there. We need to get… >>> More

Related posts about label