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.

0

4 Answers 4

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

9
  • @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: stackoverflow.com/questions/34782567/… And do you have some zpl programming examples?
    – alex
    Commented Jan 14, 2016 at 17:42
  • 1
    @alex Hi man, first go to Zpl programming guide: zebra.com/content/dam/zebra/manuals/en-us/software/… 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 labelary.com/viewer.html
    – ZuzEL
    Commented Jan 14, 2016 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
    Commented Jan 14, 2016 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
    Commented Jan 14, 2016 at 18:35
  • 4
    Confirmed it works on linux workstation too (ubuntu 16.04)
    – ikhsan
    Commented May 15, 2016 at 11:21
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
1
  • 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
    Commented Feb 3, 2021 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

4
  • 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: stackoverflow.com/questions/34782567/…
    – alex
    Commented Jan 14, 2016 at 17:57
  • 1
    @alex, I suggest you use labelary.com, grab the ZPL formed and send to printer. I've found this QA on Stack Overflow, 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
    Commented Feb 11, 2016 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
    Commented Mar 22, 2016 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
    Commented Mar 30, 2016 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]
1
  • 1
    you can edit your posts and use backticks ` around your code snippets to help highlight sections Commented Sep 26, 2017 at 15:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.