Label Collection question : Label to Image?

Hello Pipeline Pilot friends - happy spring! I hope everyone is doing well. 

I have a question about the label collection (for generating ZPL II code to send to a label printer). We're getting ready to spin up a solution to print labels for Workbook users, and would like to show them a preview of the label before we print it. Alas - no reporting component called Label to Image! I understand this may be tricky (ZPL II parsers/renderers aren't freeware), but CISPro can do this, so maybe your team can steal their technology. It would be super useful. 

(Alternatively, is this something where we can fund a project to create that component?)

Thanks! -Marty

Answers 2
IK
IK 2021-04-07 Best Answer

Hi @MB ​​​​​, unfortunately as you you point out there isn't an OOTB component that does this. The closest I've found the the UPC Barcode example protocol and a deprecated Mobile collection component called UPC-A Barcode to PNG_Image. I don't think either of those use ZPL II code, though, and I don't think it works for any format other than UPC. 

I've asked some people internally to reach out to you, so if you haven't heard from them already, you should soon. Please let me know if you have any other questions!

MB
MB 2021-04-07

Hi @IK ​​​​​​​- Thanks! In the interim, it turns out that there is a way to use a Zebra printer to render ZPL II code and return a PNG byte array to the caller, following the guidance in this article : https://stackoverflow.com/questions/7412242/print-preview-zpl-ii-commands-using-net-winform-before-sending-it-to-zebra-prin​​​​​​​​​​​​​​. I was able to convert this into a subprotocol with a little python code to do HTML rendering, so as long as one actually has a printer available, it's not too bad. There are also some rough edges with the Label collection that need to be fixed (I have a list) but it's not a showstopper. I think that the above solution is probably the easiest to implement because it doesn't depend on proprietary .NET code.