Emulate ZPL printer

27,945

Solution 1

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

Solution 2

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

Solution 3

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

Solution 4

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]
Share:
27,945
ZuzEL
Author by

ZuzEL

Software Engineer and enthusiast

Updated on July 05, 2022

Comments

  • ZuzEL
    ZuzEL almost 2 years

    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.

  • Nick Johnson
    Nick Johnson over 8 years
    Brilliant man! That is exactly what I was looking for. Thanks!
  • alex
    alex over 8 years
    @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
    alex over 8 years
    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/…
  • ZuzEL
    ZuzEL over 8 years
    @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
  • alex
    alex over 8 years
    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
    alex over 8 years
    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”
  • ZuzEL
    ZuzEL over 8 years
    @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
    ZuzEL over 8 years
    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
  • alex
    alex over 8 years
  • Lari
    Lari over 8 years
    @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.
  • Bill
    Bill over 8 years
    I installed the chrome app. now how to install the printer on windows? i tried several options not working. any assistance @Lari? thanks
  • Lari
    Lari about 8 years
    @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.
  • ikhsan
    ikhsan about 8 years
    Confirmed it works on linux workstation too (ubuntu 16.04)
  • delboy1978uk
    delboy1978uk over 6 years
    you can edit your posts and use backticks ` around your code snippets to help highlight sections
  • kapil pandey
    kapil pandey almost 4 years
    Brilliant answer mate! You saved my day.Thanks a ton!!!
  • Roger
    Roger over 3 years
    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?
  • jagadishlakkurcom jagadishlakk
    jagadishlakkurcom jagadishlakk over 2 years
    amazing work like wonder