24

To emulate ZPL printer on my mac I searched through internet for a few days. Finally I've got a solution to post here, so other users could find it helpful. I wanted to post my solution here Emulate Zebra printer

But "thanks" for those who decided that this question duplicates another one, which in my opinion totally false. So the only option for me is to create another question and answer to it.

Community
  • 1
  • 1
ZuzEL
  • 12,768
  • 8
  • 47
  • 68

4 Answers4

32

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. enter image description here

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:

enter image description here

ZuzEL
  • 12,768
  • 8
  • 47
  • 68
  • @ZuzEL, hope you can help out point me in the right direction. I generated a badge pdf which i thought could be printed on a zebra badge. But now I am afraid this isn't the case. How can I convert QR-code and simple text to be printed by Zebra. Here is the badge Iayout I want to generate: http://stackoverflow.com/questions/34782567/pdf-library-tcpdf-in-landscape-orientation-and-pdf-setxy-doesnt-work-as-expect And do you have some zpl programming examples? – alex Jan 14 '16 at 17:42
  • 1
    @alex Hi man, first go to Zpl programming guide: https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf On page 126 you will see how to generate QR codes. Then go to page 186 and see how to print text with FB - field block. Then go and test everything here http://labelary.com/viewer.html – ZuzEL Jan 14 '16 at 17:58
  • hmm, the simple QR code example on page 126 ` ^XA ^FO100,100 ^BQN,2,10 ^FDMM,AAC-42^FS ^XZ` should display a simple QR code in labelary.com/viewer.html, correct? – alex Jan 14 '16 at 18:18
  • QR code doesn't seem to be rendered in labelary.com/viewer.html oh and how do i print with the zpl addon `lp -o "raw" -q1 -d zpl <<< "CT~~CD,~CC^~CT~ ^XA^FO100,100^BCN, 100,Y, N,^FDYourTextHere^FS^XZ”` – alex Jan 14 '16 at 18:35
  • @alex you are right. QR code somehow does not work on this testing site. But it's not your fault, it is an issue of this testing service. Since chrome app from my solution also uses this web service to render zpl, it will not work in this printer simulator.. – ZuzEL Jan 14 '16 at 19:07
  • for example this works: `^XA ^FO100,100 ^BXN,10,200 ^FDZEBRA TECHNOLOGIES CORPORATION 333 CORPORATE WOODS PARKWAY VERNON HILLS, IL 60061-3109^FS ^XZ`. Now I see a lot of zpl specification is not implemented on this site. Sorry for that. Although it does not mean zebra printer will not print it right – ZuzEL Jan 14 '16 at 19:11
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/100695/discussion-between-alex-and-zuzel). – alex Jan 14 '16 at 19:21
  • 4
    Confirmed it works on linux workstation too (ubuntu 16.04) – ikhsan May 15 '16 at 11:21
  • Interesting thing for me is that the data sometimes get splitter in package which makes the label splitter as well – Stan Jan 27 '23 at 05:31
28

Step by step to install on (tested in ):

  1. Install the ZPL Printer app from the Chrome store
  2. Run the app and make sure it's toggled On. toggled On
  3. Open Printers & scanners or Devices & Printers in Control Panel.
  4. Add a printer. (Optional! Only if you select from control panel)
  5. Select "The printer I want wasn't listed"
  6. Select Add a Local Printer. Then next add local printer
  7. Create a new port - Standard TCP/IP. Use IP 127.0.0.1
  8. Let Windows detect the port and it will eventually return an error.
  9. Select Device Type -> Custom.
  10. Press settings and make sure you have IP Address 127.0.0.1, Protocol RAW and port 9100.
  11. Click OK and Next.
  12. Wait for it to fail to detect driver model.
  13. Select Generic and Generic/Text Only.
  14. Next a few times then Name your printer.
  15. Create your test script

    ^XA
    ^FO250,40^A0N,70,70^FDLPN^FS
    ^FO30,120^A0N,50,50
    ^BCN,100,N,N,N
    ^FD1000001^SFddddddd^FS
    ^FO200,300^A0N,50,50
    ^FD1000001^SFddddddd^FS
    ^PQ50
    ^XZ
    
  16. Print, select your new named printer and Print. print
  17. Viola! printed
Mukyuu
  • 6,436
  • 8
  • 40
  • 59
  • Try to follow guide but not able to toggle it on. Get following error "Error occurs while creating Printer on Host: 127.0.0.1 Port: 9100". Is there anyone out there who can point me in the right direction to fix this? – Roger Feb 03 '21 at 15:33
9

Works on as well. Tested it on .

After installation of Chrome App (link provided by @ZuzEL) and Printer Install, open Notepad and type ZPL code, print it on this newly added printer and "voilá"! Print Test

As a @Bill request, I've added some screenshots of my windows printer properties, after install. It's a TCP/IP printer with Generic/Text Only driver, on IP 127.0.0.1 and port 9100, the defaults of chrome app.

Printer Properties 1

Printer Properties 2

Printer Properties 3

Printer Properties 4

Community
  • 1
  • 1
Lari
  • 800
  • 7
  • 18
  • 1
    would you mind telling me how I can type ZPL code, better yet is there a PHPtoZPL library? I am trying to recreate this badge: http://stackoverflow.com/questions/34782567/pdf-library-tcpdf-in-landscape-orientation-and-pdf-setxy-doesnt-work-as-expect – alex Jan 14 '16 at 17:57
  • 1
    @alex, I suggest you use [labelary.com](http://labelary.com/viewer.html), grab the ZPL formed and send to printer. I've found [this QA on Stack Overflow](http://stackoverflow.com/questions/3766228/php-to-zebra-printer), maybe it helps you more. I'm not familiar with PHP code, because I'm a C# programmer, but I think this question mentioned will help you. Sorry by the late response and my terrible English. – Lari Feb 11 '16 at 10:36
  • 1
    I installed the chrome app. now how to install the printer on windows? i tried several options not working. any assistance @Lari? thanks – Bill Mar 22 '16 at 13:40
  • @Bill, I've added my printer installation details on my answer. I installed a TCP/IP printer with Generic/Text Only driver on IP 127.0.0.1 and Port 9100, the defaults of chrome app. Please, let me know if you still need assistance. – Lari Mar 30 '16 at 14:06
2

Wonderful. This test label command worked fine for me on RHEL7.3.

lpr -o "raw" -P MYPRINTER <<< "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"

tail -f /var/log/cups/access_log

localhost - - [26/Sep/2017:10:32:09 -0400] "POST /printers/MYPRINTER HTTP/1.1" 200 397 Send-Document successful-ok

[MYPRINTER Test label][1]
delboy1978uk
  • 12,118
  • 2
  • 21
  • 39
Vasudeva R
  • 21
  • 1