This project is read-only.

Getting SharpZebra ZPL Patch to work??

Jun 17, 2010 at 4:56 PM
Hi Guys, I have the Sharp Zebra ZPL dll compiled and linked to my c# application. Unfortunately I cannot get it to work. I have tried a simple print command to get the zebra printer to respond, but to no avail. When I print, I see that the zebra printer is receiving data, but nothing else happens. I dont know if it needs to be initialised in some way beforehand?? I am trying to print a single line to the printer: PrinterSettings ps = new PrinterSettings(); ps.PrinterName = "ZDesigner S4M-300dpi ZPL"; new SpoolPrinter(ps).Print(ZPLCommands.TextWrite(5, 5, ElementDrawRotation.NO_ROTATION, 10, "Test")); I know its a long shot, but any ideas? regards Danny
Jun 22, 2010 at 2:30 PM
Edited Jun 22, 2010 at 2:31 PM

You need to start with with a ClearPrinter command and finish with a PrintBuffer command.

List<byte> page = new List<byte>();
page.AddRange(ZPLCommands.TextWrite(5, 5, ElementDrawRotation.NO_ROTATION, 10, "Test"));
new SpoolPrinter(ps).Print(page.ToArray());

Jul 22, 2010 at 4:40 PM
Hi rkone, where can i find those commands? I'm trying to follow the 2 minutes instructions and not having any error but no printing activity too. Thanks RNA
Jul 22, 2010 at 8:04 PM

They're only available in my patched version that supports ZPL. 

If you're having problems printing to an EPL printer using the normal SharpZebra codebase, you'll have to give a more detailed description of what you're doing.

If you're trying to print to a ZPL printer, you'll have to download my patched version under source code / patches.




Jul 23, 2010 at 6:24 PM
Thanks, I'll do the download and try it. RNA RNA
Mar 9, 2011 at 10:56 PM
Edited Mar 9, 2011 at 11:00 PM


I'm pretty new at this C# programming and I would like some help.

Can anyone post a method to print a barcode label (code 39) in EPL and the same in ZPL, having some control at least in the dimensions of it (this will be used in a web application).

If needed, I can generate a barcode in pcx format to use in the method.

I will use the LPT1 port to send the generated command, but I just need the methods to generate them. I already downloaded the referenced Patch but I'm having some problems crossing both approches.




Mar 10, 2011 at 9:45 PM
Edited Mar 10, 2011 at 9:46 PM
PrinterSettings ps = new PrinterSettings(); 
ps.PrinterName = "ZDesigner S4M-300dpi ZPL"; 

List<byte> page = new List<byte>();
Barcode barSerial = new Barcode();
page.AddRange(ZPLCommands.BarCodeWrite(5, 5, 30,  ElementDrawRotation.NO_ROTATION, barSerial, false, "Test" ,ps));
new SpoolPrinter(ps).Print(page.ToArray());


Make sure ps.PrinterName matches what you've got the printer called in Windows.  EPL is the same, just replace ZPLCommands with EPLCommands.

Feb 3, 2012 at 11:28 AM
Edited Feb 3, 2012 at 11:29 AM

Sorry ....
I found it very interesting to your problem but
how do I download the patched version

Feb 3, 2012 at 11:57 AM

This site is really difficult to navigate:

Goto Source code -> Patches link.