Skip to content

Step 4: Show the tag number

A barcode is for scanners. Add the digits underneath for people.

  1. Add a Text layer and set its Layer description to Tag number.
  2. Drag it into a thin strip directly below the barcode, the same width: X: 5% – 95%, Y: 55% – 62%.
  3. Set Value template to {{ package.label | boldEndingDigits }}.
  4. Set Font Size to 7 and Resize Strategy to Shrink Text.

The | boldEndingDigits part 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 Text steps the font down until it does. The alternatives are Truncate Text, which cuts and adds an ellipsis, and Allow Overflow, which lets it spill. All three are compared side by side.

Labels with the tag number below the barcode

Printed PDF • Layout JSON

Behind the scenes
{
  "name": "Tutorial label",
  "labelContentLayoutElements": [
    {
      "description": "Tag barcode",
      "elementType": "CODE128_BARCODE",
      "xStartFraction": 0.05,
      "xEndFraction": 0.95,
      "yStartFraction": 0.46,
      "yEndFraction": 0.66,
      "valueTemplate": "{{ package.label }}"
    },
    {
      "description": "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