DEVELOPERS / TEMPLATES / VARIABLE DATA
Design the Label Once. Send Only the Data From Code.
Stop building labels in ZPL strings. Design the label visually, then send only the data from your code: names, barcodes, QR codes, dates. Python, Node.js, .NET and Go.
variables = client.designs.list_variables("dsg_shipping")THE PROBLEM
Most label code ends up as string concatenation: ZPL coordinates in one file, font sizes in another, and a two-day change every time marketing moves the logo. It also only works on the printer language it was written for.
With LabelInn the layout lives in a design, edited visually by whoever owns the label. Your code sends the values.
01 / TEMPLATES
1. Design the label
In LabelInn, place text, barcodes (Code 128, EAN, GS1-128, QR, Data Matrix and more), images and shapes. Give the variable parts names such as order_id, customer and barcode. List them from code to check:
variables = client.designs.list_variables("dsg_shipping")03 / BARCODES
3. Preview before you print
preview = client.designs.render("dsg_shipping", data={"order_id": "ORD-9876"})04 / SDK
Why this beats ZPL strings
| ZPL in code | Template + data |
|---|---|
| Layout changes need a developer and a deploy | Layout changes in the designer; code untouched |
| Works on ZPL printers only | Converted to ZPL, TSPL, TPCL or ESC/Label per printer |
| Fonts, images and barcodes by hand | Placed visually, previewed before printing |
| Every version lives in your repo | Designs can be published as fixed snapshots |
05 / TEMPLATES
When the data is already in a system
If the values live in a spreadsheet, a database or another API, you may not need code at all: a workflow can read them and print. And when your code should start that workflow, see triggering a workflow from code.
Printing through the API is part of the Pro plan, and the free trial includes it. Keys that start with sk_test_ run against a sandbox that never prints, so you can build and test before going live. See pricing.
QUESTIONS / FAQ
Frequently asked questions
How do I print a label with variable data from code?
Design the label in LabelInn with named fields, then call print.create with payload_type "template", the design id and a data object whose keys match the field names.
Can the same template print on Zebra and TSC printers?
Yes. LabelInn converts the design to each printer's own language, such as ZPL for Zebra and TSPL for TSC.
Can I preview the label before printing?
Yes. designs.render returns a preview of the design filled with your data.
KEEP GOING
Related
NEXT STEP / LABELINN
Move label layout out of your code
Design the label once and let your code send only what changes. · Visual designer · Data from your code · Any printer language