Skip to content

Changing the part label template

Michael Brown edited this page May 3, 2023 · 3 revisions

How to change the part label template

Note: A new UI is coming soon which will allow you to drag & drop part label design elements

The part label template is stored in appsettings.json in the section named PrinterConfiguration => PartLabelTemplate along with your Binner installation. It can also be modified in the Settings page of Binner.

image Part Label Template on the settings page

There are 4 lines available to configure and 2 identifiers which are usually rotated vertically which are used to indicate the Bin Number location.

30346 Label Example

Binner

Configuration example

// appsettings.json
{
  "PrinterConfiguration": {
    // DYMO LabelWriter 450, DYMO LabelWriter 450 Twin Turbo
    "PrinterName": "DYMO LabelWriter 450 Twin Turbo",
    // Auto or Left, Right for DYMO LabelWriter 450 Twin Turbo
    "PartLabelSource": "Right",
    // Label name, such as 30346 or 30277)
    "PartLabelName": "30346",
    "PartLabelTemplate": {
      "Line1": {
        "label": 1,
        "content": "{partNumber}",
        "fontName": "Segoe UI",
        "fontSize": 16,
        "autoSize": true,
        "upperCase": true
      },
      "Line2": {
        "label": 1,
        "content": "{description}",
        "fontName": "Roboto Mono",
        "fontSize": 6
      },
      // description line 2 will be automatically wrapped from line 1
      "Line3": {
        "label": 1,
        "content": "{description}",
        "fontName": "Roboto Mono",
        "fontSize": 6
      },
      "Line4": {
        "label": 1,
        "content": "{partNumber}",
        "barcode": true
      },
      "Identifier": {
        "label": 1,
        "content": "{binNumber}",
        "fontName": "Segoe UI",
        "fontSize": 10,
        "color": "#ee0000",
        "rotate": 90,
        "position": "left",
        "upperCase": true,
        "margin": {
          "top": 25
        }
      },
      "Identifier2": {
        "label": 1,
        "content": "{binNumber2}",
        "fontName": "Segoe UI",
        "fontSize": 10,
        "color": "#ee0000",
        "rotate": 90,
        "position": "right",
        "upperCase": true,
        "margin": {
          "top": 25,
          "left": 20
        }
      }
    },
    "LabelDefinitions": [
    {
      "MediaSize": {
        "ModelName": "30277",
        "Name": "File Folder (2 up)",
        "DriverName": "w82h248",
        "ExtraData": "",
        "Width": 82,
        "Height": 248
      },
      "TopMargin": -20,
      "LeftMargin": 0,
      "LabelCount": 2,
      "TotalLines": 2
    },
    {
      "MediaSize": {
        "ModelName": "30346",
        "Name": "1/2 in x 1-7/8 in",
        "DriverName": "w36h136",
        "ExtraData": "",
        "Width": 36,
        "Height": 136
      },
      "TopMargin": -20,
      "LeftMargin": 0,
      "LabelCount": 1,
      "TotalLines": 2
    },
    {
      "MediaSize": {
        "ModelName": "30252",
        "Name": "Address",
        "DriverName": "w79h252",
        "ExtraData": "",
        "Width": 79,
        "Height": 252
      },
      "TopMargin": -20,
      "LeftMargin": 0,
      "LabelCount": 1,
      "TotalLines": 4
    },
    {
      "MediaSize": {
        "ModelName": "30327",
        "Name": "File Folder",
        "DriverName": "w57h248",
        "ExtraData": "",
        "Width": 57,
        "Height": 286
      },
      "TopMargin": -20,
      "LeftMargin": 0,
      "LabelCount": 1,
      "TotalLines": 4
    }
    ]
  }
}

PartLabelTemplate Line options

The Part Label Template can be modified to display up to 4 lines and an optional identifier (usually the Bin Number, vertically). These are the properties available for each Line template:

  • label [number] - specify which label to print the line on, for label paper that is ganged in 1's, 2's, or offset. By default, 30346 paper is a single label but it is in label position 2, with label position 1 being empty. 30277 paper is ganged in 2's so you can choose which label to print on (1 or 2).
  • content [string] - the template or text to display. Template fields are enclosed by braces {fieldName}. All fields reference a Part property, such as partNumber, description, manufacturer, manufacturerPartNumber, location, binNumber, binNumber2, quantity, lowStockThreshold, cost, digiKeyPartNumber, mouserPartNumber, packageType, mountingType, partType, partId, keywords, datasheetUrl.
  • fontName [string] - any valid font name, default is Segoe UI
  • fontSize [number] - font size in points, default is 16
  • color [string] - font color in hex, default is #000000
  • autoSize [bool] - if the text exceeds the width, the font size will be scaled down to fit
  • upperCase [bool] - converts all text to uppercase
  • lowerCase [bool] - converts all text to lowercase
  • rotate [number] - degrees to rotate text
  • position [string] - center, right, left
  • margin [object] - specifies left, right, top, bottom margins around the line
  • barcode [bool] - specifies to encode the text as a barcode