Step 4: Show the tag number¶
A barcode is for scanners. Add the digits underneath for people.
- Add a
Textelement. - Set X Start to
5%, X End to95%. - Set Y Start to
55%, Y End to62%. - Set Value template to
{{ package.label | boldEndingDigits }}. - Set Font size to
7and Resize Strategy toShrink Text.
The
| boldEndingDigitspart is a filter: it transforms the value on its way onto the label. This one bolds the significant digits at the end of a Metrc tag, so a human can read the part that actually differs between packages. See Filters for the rest.Resize Strategy decides what happens when text does not fit.
Shrink Textsteps the font down until it does. The alternatives areTruncate Text, which cuts and adds an ellipsis, andAllow Overflow, which lets it spill. All three are compared side by side.
Behind the scenes
{
"name": "Tutorial label",
"labelContentLayoutElements": [
{
"name": "Tag barcode",
"elementType": "CODE128_BARCODE",
"xStartFraction": 0.05,
"xEndFraction": 0.95,
"yStartFraction": 0.46,
"yEndFraction": 0.66,
"valueTemplate": "{{ package.label }}"
},
{
"name": "Tag number",
"elementType": "TEXT",
"xStartFraction": 0.05,
"xEndFraction": 0.95,
"yStartFraction": 0.38,
"yEndFraction": 0.45,
"valueTemplate": "{{ package.label | boldEndingDigits }}",
"paragraphFontName": "Helvetica",
"paragraphFontSize": 7,
"paragraphSpacing": 8,
"horizontalParagraphAlignment": "CENTER",
"paragraphTextResizeStrategy": "SHRINK_TEXT"
}
]
}
Next Steps¶
- Continue to step 5, Add your logo.
- Back to step 3, Add a scannable barcode.
- All tutorial steps
- Text styling and filters: Layout Element Values.