Generate and Print Barcodes API

// Expert user has replied.
J Jacob Kerber 1 year 7 months ago
150 5 0

We are currently working through our process flow for the APIs but are having issues with the file upload part. We have multiple ZD611Ts and ZD411s in our environment. I have created a barcode using the designer and have the prn file. I can successfully print the prn file using Postman. We have a webapp that handles our inventory management. We want our webapp to make an API call to print a unique barcode after a part is scanned. Here are our questions:

1. Can I send just the prn code, not the file? That would make it very easy for us to edit the data part of the barcode and keep the rest of the config.
2. If not, how can I pass the response from the generate barcode api to the print file api? 

Any help would be greatly appreciated!

Thank you!

Please Register or Login to post a reply

5 Replies

S Steven Si

The barcode generator API provides a convenient way of getting barcode images for applications that just needs the barcode images. With Zebra printers, there is no need to use the barcode generator API. The ZebraDesigner output files (*.prn) can be sent directly to any Zebra printers to print the barcode directly. The *.prn is a text file, while the output from the barcode generator API is a binary image file. It's a lot easier to deal with the *.prn text file. I would recommend to use the *.prn file based on your use case.

J Jacob Kerber

Steven,

Thank you for your response. How can I pass that .prn file to the DocumentPrint API? Can I point the zpl parameter to a URL that contains the file? Could I pass the file text?

S Steven Si

I am unfamiliar with the DocumentPrint API. Depending on how the printers are connected to your application. You said that your app is a webapp. The simplest way is to use the SendFileToPrinter API to send the *.prn to the printers with the cloud connection. Here is an article to get started with - Use the SendFileToPrinter API for Your Cloud-Based Printing Needs. Alternatively, the Browser Print is another way to print from a webapp.

J Jacob Kerber

The SendFileToPrint API needs to have a file uploaded with it. Can I pint to zpl file parameter to a URL? How is the API reading the file. Is it converting it to base64? 

S Steven Si

The SendFileToPrinter API requires a file, not URL. You already have the *.prn file for the barcode generated from the ZebraDesigner tool. You simply need to replace the text for the barcode in the *.prn file before calling the SendFileToPrinter API, so you get different barcode label each time. You cannot pass a URL to the SendFileToPrinter API, but you can pass a file object instead. The API doesn't do a conversion to Base64. If you want print a barcode image, you need to convert the image to Base64 and wrap it with ZPL commands.

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