ZPL: Z64 Compression, Encoding, and CRC-check for .NET Framework/C#

T Tim Borowsky 3 years 7 months ago
929 2 0

Hello,
 
I am developing software in C# for the .NET Framework that takes a QR code represented in a .PNG image and converts it to the ZPL format.  With that said, although printing a single label with the QR code on it does not present an issue, sending the printer a data stream consisting of 10 labels, the printer indicates an out of memory error.
 
Is there an API for the .NET framework for the Z64 encoding as is stated in the ZPL II programming guide? This API will be required to support .NET Framework 2.0, as some of our customers are still on that version.
 
I know this is what your ZebraDesigner 2 software uses to print QR codes.
 
Otherwise, do you know of any algorithms for C# that can be used to perform the Z64 encoding that I can stitch together? That includes compression, encoding, and CRC-checking.
 
Thanks!
-Tim

Please Register or Login to post a reply

2 Replies

Y Yanis Dalabiras

Hi Tim, The newly released .NET SDK should be of great help here.  You can integrate the SDK fully to enable printing(GraphicsUtil.PrintImage), or just use the image conversion API (PrinterUtil.ConvertGraphic), if you have your own methods to communicate to the printers.
Robin

Y Yanis Dalabiras

Hi Tim,
Sorry I don't have sample code at this point, but I would look into the following .Net framework 2.0 methods for B64 encoding:
Convert.ToBase64String(byte[])
and How to generate a CRC-16 from C# - Stack Overflow  or https://www.codeproject.com/Articles/35134/How-to-calculate-a-CRC-in-Cs…
We are using the IBM standard CRC16 checksum.  The png file in bytes should be your input into the base64 converter.

Some of our older printers do not have much memory in them, so you may want to consider updating to one with larger memory and image processing speed.

Hope this at least points you in the right direction.  I'll see about getting some sample code together.

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