Unofficial Labelary ZPL Viewer custom widget

Hello everyone.

Here is a ready-to-use ZPL custom widget that I made. While based on the official Tulip one, I designed it to take more advantage of the Labelary API’s capabilities for single label ZPL rendering. It contains several new features (some needed by one of my customers along with others I deemed necessary):

  • control over the label image’s dpmm (dpi-like unit), width and height
  • selection of a sizing unit (cm, mm, in)
  • optional label centering
  • optional label containment (large labels are proportionally shrinked to fit in the widget area)
  • use of HTTPS (improves security and confidentiality)
  • clean ZPL code escaping (notably allows to use line separators (\&) to properly center text using field blocks (^FB))
  • automatic sizing (label will fill widget area if width or height is undefined)
  • detailed widget and properties descriptions

Note that even if automatic sizing was well tested, it is still something a bit experimental.

I did the best I could (with the time at my disposal) to make this widget simple, useful and bug-free. I hope you will enjoy it :slight_smile:

customWidget-Unofficial Labelary ZPL Viewer.json (8.6 KB)

7 Likes

Fabien,

This is awesome, thank you so much for sharing! I am going to play with this later today :slight_smile:

Tagging @jmlowden since he is often playing with printing on zebra printers (I know custom widgets aren’t ideal for gxp use cases but still could be helpful for anything non-gxp or just to learn from)

@nelsonj @Richard-SNN @ChrisF @Fiora @youri.regnaud are some others I know have worked with Zebra printers / asked questions about them in the past, so also tagging as you may find this helpful!

@Beth Very cool, will check this out - we are working through what documentation/testing is required in the event we want to include custom widgets for non-GxP convenience/visualization within GxP applications.

@fti Do you know if there is a way to encode in ZPL to have longer-form content spill over across multiple labels? The use case I have in mind is to use our same 4x3 label stock to print packing lists, but if the list is long enough it would print across multiple labels. This is the appearance, anyway, that you get when you command the printer to produce its Printer Configuration Report, like the following (although perhaps this is actually three separate print commands):

2 Likes

Hello @jmlowden.

Unfortunately I don’t know any way of doing this that would save you from having to manually adjust commands to print several labels (^XA…^XZ) or adjust numeric command parameters for element dimensions and offsets (^FO). In your case, I would recommend using larger labels (or reducing font size maybe?) since it would save you several headaches.

I totally get your need for this though. I’m not a printer expert so I don’t know if there is a setting to do what you want (and if there isn’t, I couldn’t confidently explain you why). I think it would be interesting to ask this question on the Zebra forum someday.

Regarding the widget, I focused on single label rendering since it is probably the most frequent use case by far. It is also much simpler to handle (simpler layout, single image loading) and makes the widget easier to use.

That being said, I think it might be worth adding support for Labelary’s index parameter. If ZPL code contains several labels (^XA…^XZ), this allows to select which label is displayed using a 0-based index. This would make complete sense for previewing labels with “<” / “>” buttons (dynamically changing the index) or printing several labels on a page (using one widget per label).

2 Likes