Emulate Zpl Printer

Emulate ZPL printer

So, to emulate ZPL printer on your mac (possibly windows too):

  1. Install this chrome app Zpl Printer
  2. Go to printer settings, add new one.
    Sample Image

Port can vary. Double-check it.


  1. Make sure everything turned on.

To test it, try in your terminal:

lp -o "raw" -q1 -d zpl <<<
"CT~~CD,~CC^~CT~^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,
6~SD15^JUS^LRN^CI0^XZ^XA^MMT^PW508^LL0203^LS0^BY4,3,138^FT48,155^BCN,,
Y,N^FD>;12^FS^PQ1,0,1,Y^XZ"

If everything tuned properly, in ZPL printer you will see:

Sample Image

Emulate Zebra printer

Take a look at ZPLViewer - it works relatively well for rendering simple ZPL code but seems to fail on anything complex.

Best bet is just to purchase a printer. You can get a ZP-450 for $200. Get one with Ethernet ($100 more) and you can use the printer admin page to upload ZPL and render on-screen so you don't have to spew labels.

How do I permanently set the port to 9100 when printing from Excel VBA to the ZPL Printer Zebra label printer Chrome plug-in emulator



I moved the ZPLII code back into Notepad to verify that I could still print from that app...I could not. It was because the the XA and XZ commands were missing all along. Somewhere along in the process, I got distracted by the whole port issue and forgot to include these crucial lines in the code.

So now the following code prints to the next available port, which is not really what I wanted to do (I wanted to force it to print to 9100 every time), but it works for what I need it to do.

Also, if I noticed that if ":9100" is not present in the line MyPrinter = "\\127.0.0.1\ZebraSim:9100" then the PDF file does not get generated. I still get a simulated print-out in the ZPL Printer window, but no file is generated. Thanks to Delphi Coder for that suggestion as it will be a good thing to have those PDFs on-hand if I need them.

Sub FourByTwo()
Dim MyPrinter As String, NumLabels As Integer
MyPrinter = "\\127.0.0.1\ZebraSim:9100"
NumLabels = 1
Open MyPrinter For Output As #1
Print #1, "^XA"
Print #1, "^PQ" & NumLabels
Print #1, "^LT0"
Print #1, "^MD3"
Print #1, "^POI"
Print #1, "^FO100,100^A0,25,25^FDSample 1^FS"
Print #1, "^XZ"
Close #1
End Sub

Simulate printing in ZPL

I'm learning ZPL from here: it's provided by Zebra Website. I think it's very helpfull.

If you want simulate the printing, you can use labelary.

Emulate EPL2 Printer Serverside

You'd have to code an app to do it. As far as I know, Zebra hasn't released the fonts built into the printer though, so it would be very tedious...

Barcode wasn't printed as many as the Request

What I did to solve this was to make each request on a separate tab and closed the tab once it's executed. To make it simple I make it into a separate function.

Request script changed into:

for (var i = 0; i < rows.length; i++) {
if (i > 0)
delayPrint(rows[i], i); // separate function
else
javascript: jsWebClientPrint.print('useDefaultPrinter=' + $('#useDefaultPrinter').attr('checked') + '&printerName=' + $('#installedPrinterName').val() + '¶m=' + rows[i].value);
}

separate function used for delaying request and to make each request on a separate tab and closed the tab once it's executed:

function delayPrint(data, interval) {
setTimeout(function() {
var wnd = window.open('webclientprint:' + domain + ('useDefaultPrinter=' + $('#useDefaultPrinter').attr('checked') + '&printerName=' + $('#installedPrinterName').val() + '¶m=' + rows[i].value));
setTimeout(function() {
wnd.close(); // close once it's done
}, 1000);
}, interval * 3000);
}


Related Topics



Leave a reply



Submit