3

My WinForms c# app uses Zebra label printers extensively, and we make use of both EPL and ZPL printing mode. After much testing we've found that when the windows print spooler sends commands to the printer it immediately sends a status command to the same printer after the print. It somehow knows what the status command is, either from the drivers or the printer itself, which is "^HS".

The problem is when we switch the printer into EPL mode, the status command is sent, but it is in ZPL format and no response comes from the printer. This lack of response causes a significant delay in the windows print spooler while it times out waiting for a response.

I'm using the standard code in the below link to print.

https://github.com/andyyou/SendToPrinter/blob/master/Printer/RawPrinterHelper.cs

When we use the Zebra direct connect SDK we can talk straight to the printer, ignoring the windows print spooler, and no such status command is sent. This is the behavior we want, but the Zebra SDK is not suitable for our purposes.

Anyone know how we can alter this behaviour of the windows spooler?

Sample code, using the RawPrinterHelper in the link above :

//Standard Zebra SGD to set ZPL language
string SetZPL = "! U1 setvar \"device.languages\" \"zpl\"\n";
//Standard Zebra SGD to set EPL language
string SetEPL = "! U1 setvar \"device.languages\" \"epl\"\n";

//Push to ensure printer is in ZPL mode
RawPrinterHelper.SendStringToPrinter(printerName, SetZPL);
//Set printer into EPL mode - This is where the delay occurs
RawPrinterHelper.SendStringToPrinter(printerName, SetEPL);
Tony Cheetham
  • 877
  • 7
  • 18
  • So far I have found code similar to what you linked. [here](https://stackoverflow.com/a/36804030/5233410). check to see if others have similar problem to what you experienced. – Nkosi Sep 19 '19 at 13:00
  • He's using the same MS example class to send the ZPL, but the issue is to do with his formatting(I'm no EPL expert, but I can see it's really messy). One of the guys does mention you shouldn't be sending "page" commands to the printer for a direct port print. I'll give that a go, report back. – Tony Cheetham Sep 19 '19 at 13:07
  • Actually, I jumped the gun.. The printer said it was working, but without the document headers it was just lying to me and pretending to work.. I hate these printers so much. Sorry, that was not a fix, will delete previous comment. – Tony Cheetham Sep 19 '19 at 13:41
  • Noted. back to the drawing board i guess. I'll keep a look out. – Nkosi Sep 19 '19 at 13:42
  • I've found Zebra's documentation: [Zebra EPL Printer Line Print Mode](https://supportcommunity.zebra.com/s/article/Zebra-EPL-Printer-Line-Print-Mode?language=en_US), which states that line print mode switch is: `! U1 setvar "device.languages" "line_print"` A manual (pdf) is [here](https://support.zebra.com/cpws/docs/eltron/epl/epl1_manual.pdf) – Maciej Los Jun 26 '20 at 07:45
  • @MaciejLos I'm afraid Line Print mode isn't really relevant here, we need EPL mode to be activated. – Tony Cheetham Jun 26 '20 at 10:27
  • As per Zebra's printers documentation, it's not clear. They using "line_print" mode together with EPL. There's also EPL1 and EPL2 mode: 1 - emulation (line mode), 2 - page mode. See: [EPL1 Line Mode Printing Examples](https://support.zebra.com/cpws/docs/eltron/epl1/epl1_print_ex.htm) – Maciej Los Jun 26 '20 at 11:50

1 Answers1

0

When I use ZPL as a solution for printing in the past my string had to start with

^XA

and end with

^XZ

There is an online editor where you can play around with ZPL code in real time. I believe that when you are using this code it just writes straight towards the printer. I am not as familiar with EPL though, I am unsure why that would be slower.

Hard to know why there is a delay or if EPL is just inherently slower

  • The delay is is caused by the print driver. When you switch to EPL mode, the print driver sends a "Status" command, to check the printer is working and is active. But for the first message after you switch formats, the command that is sent is in ZPL format and the printer does not understand it, and in typical zebra form it just ignores the command. The printer driver then has to sit there waiting for a timeout, and you get the delay. I'm 99% sure there is no solution to this, as it's a pretty niche use case. – Tony Cheetham Jul 02 '20 at 00:19