Printing ZPL via cmd/command line

L Lode Bosmans 3 years 7 months ago
2670 3 0

Dear Zebra community,

I would like call on your help. I'm trying to send ZPL code directly from matlab to our Zebra (network) printer. Currently, we open the Zebra Setup Utilities and insert the code manually. I would like to get rid of the manual step.

Zebra support has provided me with instructions for FTP file transfer, see attachment. I used the instructions and applied them via cmd/command line manually, with a positive result. However, these are multiple commands, including inserting a (default) username. If I insert the sequential commands, I'm able to print the ZPL code. However, I'm not able to send just one command to get the labels printed.

When using the same code in matlab, the first command is no problem when inserting it via the 'system' or 'dos' function. The IP address of the printer is accepted. But then the user name is required and I can't use the 'system' or 'dos' function to insert the username. So here it stops.

Therefore I am searching for a way to send the ZPL code to the printer with only one command (including definition of IP address and filename pathway)? Is there anyone who can help me with this issue?

Thanks in advance for your replies!

Best regards,
Lode

Please Register or Login to post a reply

3 Replies

E Efkan YILMAZ

Hi Lode,
Please take a look at this article for a better alternative.

There are one-line commands to send raw ZPL to your printer over TCP or USB.

L Lode Bosmans

Hi Robin,

thank you for the information. I installed the link-OS SDK. I am able to call the commands via command line and discover the IP-address of our printer (172.20.30.3). We have to work with a network printer, as we have two production sites (one in Belgium and one in the US) who need to use the same online windows server. Both production sites have their own local Zebra printer that can be used.

The print command states that it requires an xml or csv file. I only have text files containing the code on the bottom of this reply. It is a list of labels with the same format.

Could you give an example on how to send this to the network printer in one command? If possible while using the text file containing the code below. If it does need to be an xml or csv, can you also show the format these files in which it needs to provided?

Thanks in advance for your reply!

Best regards,
Lode

${
^XA^CFV^POI^FO60,25,0^FDRS18-KUZ-NIH^FS^FWZ,1^CFS^FO740,110,1^FDCompany name^FS^CFS^FO740,152,1^FD-^FS^CFT^FO740,35^FDC1071^FS^FWZ,0^FO60,200^GB10,1,2^FS^FO80,200^GB10,1,2^FS^FO100,200^GB10,1,2^FS^FO120,200^GB10,1,2^FS^FO140,200^GB10,1,2^FS^FO160,200^GB10,1,2^FS^FO180,200^GB10,1,2^FS^FO200,200^GB10,1,2^FS^FO220,200^GB10,1,2^FS^FO240,200^GB10,1,2^FS^FO260,200^GB10,1,2^FS^FO280,200^GB10,1,2^FS^FO300,200^GB10,1,2^FS^FO320,200^GB10,1,2^FS^FO340,200^GB10,1,2^FS^FO360,200^GB10,1,2^FS^FO380,200^GB10,1,2^FS^FO400,200^GB10,1,2^FS^FO420,200^GB10,1,2^FS^FO440,200^GB10,1,2^FS^FO460,200^GB10,1,2^FS^FO480,200^GB10,1,2^FS^FO500,200^GB10,1,2^FS^FO520,200^GB10,1,2^FS^FO540,200^GB10,1,2^FS^FO560,200^GB10,1,2^FS^FO580,200^GB10,1,2^FS^FO600,200^GB10,1,2^FS^FO620,200^GB10,1,2^FS^FO640,200^GB10,1,2^FS^FO660,200^GB10,1,2^FS^FO680,200^GB10,1,2^FS^FO700,200^GB10,1,2^FS^FO720,200^GB10,1,2^FS^CFT^FO60,220,0^FDDelivery office^FS^CFS^FO60,270,0^FDAddress^FS^FO60,310,0^FDPostal code City^FS^FO60,350,0^FDCountry^FS^FO860,320^FDMade in^FS^FO825,360^FDUnited States^FS^CFT^FWZ,1^FO1000,35,1^FD2018-07-26^FS^FWZ,0^FO810,88^BQN,2,10^FDQA,RS18-KUZ-NIH^FS^XB^XZ
^XA^CFV^POI^FO60,25,0^FDRS18-KUZ-NIH^FS^FWZ,1^CFS^FO740,110,1^FDCompany name^FS^CFS^FO740,152,1^FD-^FS^CFT^FO740,35^FDC1071^FS^FWZ,0^FO60,200^GB10,1,2^FS^FO80,200^GB10,1,2^FS^FO100,200^GB10,1,2^FS^FO120,200^GB10,1,2^FS^FO140,200^GB10,1,2^FS^FO160,200^GB10,1,2^FS^FO180,200^GB10,1,2^FS^FO200,200^GB10,1,2^FS^FO220,200^GB10,1,2^FS^FO240,200^GB10,1,2^FS^FO260,200^GB10,1,2^FS^FO280,200^GB10,1,2^FS^FO300,200^GB10,1,2^FS^FO320,200^GB10,1,2^FS^FO340,200^GB10,1,2^FS^FO360,200^GB10,1,2^FS^FO380,200^GB10,1,2^FS^FO400,200^GB10,1,2^FS^FO420,200^GB10,1,2^FS^FO440,200^GB10,1,2^FS^FO460,200^GB10,1,2^FS^FO480,200^GB10,1,2^FS^FO500,200^GB10,1,2^FS^FO520,200^GB10,1,2^FS^FO540,200^GB10,1,2^FS^FO560,200^GB10,1,2^FS^FO580,200^GB10,1,2^FS^FO600,200^GB10,1,2^FS^FO620,200^GB10,1,2^FS^FO640,200^GB10,1,2^FS^FO660,200^GB10,1,2^FS^FO680,200^GB10,1,2^FS^FO700,200^GB10,1,2^FS^FO720,200^GB10,1,2^FS^CFT^FO60,220,0^FDDelivery office^FS^CFS^FO60,270,0^FDAddress^FS^FO60,310,0^FDPostal code City^FS^FO60,350,0^FDCountry^FS^FO860,320^FDMade in^FS^FO825,360^FDUnited States^FS^CFT^FWZ,1^FO1000,35,1^FD2018-07-26^FS^FWZ,0^FO810,88^BQN,2,10^FDQA,RS18-KUZ-NIH^FS^XB^XZ
^XA^CFV^POI^FO60,25,0^FDRS18-KUZ-NIH^FS^FWZ,1^CFS^FO740,110,1^FDCompany name^FS^CFS^FO740,152,1^FD-^FS^CFT^FO740,35^FDC1071^FS^FWZ,0^FO60,200^GB10,1,2^FS^FO80,200^GB10,1,2^FS^FO100,200^GB10,1,2^FS^FO120,200^GB10,1,2^FS^FO140,200^GB10,1,2^FS^FO160,200^GB10,1,2^FS^FO180,200^GB10,1,2^FS^FO200,200^GB10,1,2^FS^FO220,200^GB10,1,2^FS^FO240,200^GB10,1,2^FS^FO260,200^GB10,1,2^FS^FO280,200^GB10,1,2^FS^FO300,200^GB10,1,2^FS^FO320,200^GB10,1,2^FS^FO340,200^GB10,1,2^FS^FO360,200^GB10,1,2^FS^FO380,200^GB10,1,2^FS^FO400,200^GB10,1,2^FS^FO420,200^GB10,1,2^FS^FO440,200^GB10,1,2^FS^FO460,200^GB10,1,2^FS^FO480,200^GB10,1,2^FS^FO500,200^GB10,1,2^FS^FO520,200^GB10,1,2^FS^FO540,200^GB10,1,2^FS^FO560,200^GB10,1,2^FS^FO580,200^GB10,1,2^FS^FO600,200^GB10,1,2^FS^FO620,200^GB10,1,2^FS^FO640,200^GB10,1,2^FS^FO660,200^GB10,1,2^FS^FO680,200^GB10,1,2^FS^FO700,200^GB10,1,2^FS^FO720,200^GB10,1,2^FS^CFT^FO60,220,0^FDDelivery office^FS^CFS^FO60,270,0^FDAddress^FS^FO60,310,0^FDPostal code City^FS^FO60,350,0^FDCountry^FS^FO860,320^FDMade in^FS^FO825,360^FDUnited States^FS^CFT^FWZ,1^FO1000,35,1^FD2018-07-26^FS^FWZ,0^FO810,88^BQN,2,10^FDQA,RS18-KUZ-NIH^FS^XZ
}$

I Illtud Daniel

Hi Robin, I've just this moment signed up to this forum and authorised the purchase of a Zebra ZC300 based on your reply above! I developed a library card printing system using ZPL 10 years ago, and our old Javelin 330i printers are giving up the ghost.

What are the big changes from that generation ZPL to todays? Glancing at the developer's guide (https://www.zebra.com/content/dam/zebra/manuals/printers/common/program…) it looks like I'd be best off starting over? At least it looks as if I don't have to separate my graphics into CMY and construct a bitmap per colour any more! Any old blogs on going from old ZPL to new, or have I missed too many generations?

CONTACT
Can’t find what you’re looking for?