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);