Emulate ZPL printer
Solution 1
So, to emulate ZPL printer on your mac (possibly windows too):
- Install this chrome app Zpl Printer
- Go to printer settings, add new one.
Port can vary. Double-check it.
- 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:
Solution 2
Step by step to install on windows (tested in windows-10):
- Install the ZPL Printer app from the Chrome store
- Run the app and make sure it's toggled On.
- Open Printers & scanners or Devices & Printers in Control Panel.
- Add a printer. (Optional! Only if you select from control panel)
- Select "The printer I want wasn't listed"
- Select Add a Local Printer. Then next
- Create a new port - Standard TCP/IP. Use IP 127.0.0.1
- Let Windows detect the port and it will eventually return an error.
- Select Device Type -> Custom.
- Press settings and make sure you have IP Address 127.0.0.1, Protocol RAW and port 9100.
- Click OK and Next.
- Wait for it to fail to detect driver model.
- Select Generic and Generic/Text Only.
- Next a few times then Name your printer.
-
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
- Print, select your new named printer and Print.
- Viola!
Solution 3
Works on windows as well. Tested it on windows-10.
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á"!
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.
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]
![ZuzEL](https://i.stack.imgur.com/4jrcn.jpg?s=256&g=1)
Comments
-
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 over 8 yearsBrilliant man! That is exactly what I was looking for. Thanks!
-
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 over 8 yearswould 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 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 over 8 yearshmm, 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 over 8 yearsQR 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 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 over 8 yearsfor 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 over 8 yearsLet us continue this discussion in chat.
-
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 over 8 yearsI installed the chrome app. now how to install the printer on windows? i tried several options not working. any assistance @Lari? thanks
-
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 about 8 yearsConfirmed it works on linux workstation too (ubuntu 16.04)
-
delboy1978uk over 6 yearsyou can edit your posts and use backticks ` around your code snippets to help
highlight sections
-
kapil pandey almost 4 yearsBrilliant answer mate! You saved my day.Thanks a ton!!!
-
Roger over 3 yearsTry 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 over 2 yearsamazing work like wonder