Emulate ZPL printer
Asked Answered
T

4

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.

Turret answered 11/10, 2015 at 15:36 Comment(0)
T
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

Turret answered 11/10, 2015 at 15:36 Comment(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: #34783067 And do you have some zpl programming examples?Pragmatism
@Pragmatism 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.htmlTurret
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?Pragmatism
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”Pragmatism
@Pragmatism 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..Turret
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 rightTurret
Let us continue this discussion in chat.Pragmatism
Confirmed it works on linux workstation too (ubuntu 16.04)Aculeus
Interesting thing for me is that the data sometimes get splitter in package which makes the label splitter as wellGuttapercha
T
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
Trustful answered 10/2, 2020 at 10:42 Comment(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?Rogerson
K
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

Knives answered 27/12, 2015 at 11:23 Comment(4)
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: #34783067Pragmatism
@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.Knives
I installed the chrome app. now how to install the printer on windows? i tried several options not working. any assistance @Lari? thanksGand
@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.Knives
P
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]
Polard answered 26/9, 2017 at 15:14 Comment(1)
you can edit your posts and use backticks ` around your code snippets to help highlight sectionsZamarripa

© 2022 - 2024 — McMap. All rights reserved.