Configure labels in TSPL

This guide explains the label settings if you are using a TSPL label printer.
You can configure your label layout in 'Settings/Printing/Labels'.
You can customize the content of your label to print on any media sizes.


1/ Dynamic content

A content (text or barcode) is a block of data to position on the label grid.
Each block has X and Y coordinates, where X position is the horizontal location from the left side of the label and Y position is the vertical location from the top side of the label.
Your label size is in dots. Depending on the resolution of your printer and the size of your labels, you will have more or less dots on the width and the height of your media. You will have to change X and Y values to position your content at the right place.
Ex: If your printer resolution is 203 dpi (dots per inch), a label of 2"x1" will have 406 dots horizontally (X) and 203 dots vertically (Y).

You can print the following contents on your labels :
– the product ID : <hibou_print_products_id>,
– the product name : <hibou_print_products_name>,
– the product variation : <hibou_print_products_size>,
– the product category : <hibou_print_products_category>,
– the product price : <hibou_print_products_price> ,
– the product price without decimals : <hibou_print_products_price_round_0>,
– the product price with 2 decimals : <hibou_print_products_price_round_2>,
– the product price weighted by the multiple : <hibou_print_products_price_weighted>,
– the product discount price : <hibou_print_products_discount_price>,
– the product barcode <hibou_print_bar_code_value>,
– the account currency: <hibou_print_currency>,
– the product supplier code : <hibou_print_products_ref_manufacturer>,
– the product external code : <hibou_print_products_ref_ext>,
– the product brand : <hibou_print_products_brand>,
– the product storage location: <hibou_print_products_storage_location>,
– the product short name: <hibou_print_products_short_name>,
– the store name: <hibou_print_store_name>,
– The misc_date information: <hibou_print_products_misc_date>,
– The misc_decimal information: <hibou_print_products_misc_decimal>,
– The misc_text information: <hibou_print_products_misc_text>,
– The misc_integer information: <hibou_print_products_misc_int>,
– The misc_varchar information: <hibou_print_products_misc_varchar>,
– The misc_varchar2 information: <hibou_print_products_misc_varchar2>,
– and any free text.


2/ Encode the label size

Each label code starts with an open code <hibou_print_tspl_start_format> and finishes with an end code <hibou_print_tspl_end_format>.
The open code includes the label size in millimeters:

Example:

<hibou_print_tspl_start_format>50|25

to print on labels of 50 x 25 mm


3/ Encode a text content

For text content (<hibou_print_tspl_add_text>), you must set the following variables in this order :
– the position (X and Y in dots),
– the font (A or 0 to 5 | 3 by default),
– the text direction (0 for horizontal, 90 for vertical, 180 horizontal inverted, 270 pour vertical inverted),
– the font height (multiplier factor from 1 to 10),
– the font width (multiplier factor from 1 to 10).
Variables are separated by pipes (|).

Example :

<hibou_print_tspl_add_text>20|10|2|0|1|1|<hibou_print_products_price> <hibou_print_currency>

<hibou_print_tspl_add_text> means we are printing a text content,
20|10 are X and Y positions of the text,
2 is the font n° 2 of the printer,
0 to print the text horizontally,
1|1 are the heigth and width of the font,
and <hibou_print_products_price> <hibou_print_currency> means we want to print the product price followed by the currency sign of the account.


4/ Encode a barcode

For barcodes (<hibou_print_tspl_bar_code>) only EAN13 are supported.
You must set the following variables in this order :
– the position (X and Y in dots),
– the height (in dots | 100 by default),
– the direction (0 for horizontal, 90 for vertical, 180 horizontal inverted, 270 pour vertical inverted).

Example :

<hibou_print_tspl_bar_code>20|300|100|0|<hibou_print_bar_code_value>

<hibou_print_tspl_bar_code> means we are printing a barcode,
20|300 are X and Y positions of the barcode,
100 for the barcode height, 0 to print the barcode in horizontal,
and <hibou_print_bar_code_value> to print the product barcode.


5/ Encode a QR code

For QR codes (<hibou_print_tspl_dmatrix>), you must set the following variables in this order :
– the position (X and Y in dots),
– the height (in dots),
– the width (in dots).

Example :

<hibou_print_tspl_dmatrix>20|50|80|80|https://www.google.com

<hibou_print_tspl_dmatrix> means we are printing a QR code,
20|50 are X and Y positions of the QR code,
80-80 are the dimensions of the QR code,
and then the content to encode (the Google website in this example).


6/ An example

Here is the code for the following label:

<hibou_print_tspl_start_format>50|25
//Open code

<hibou_print_tspl_add_text>20|25|2|0|1|1|<hibou_print_products_name>
//Print the product name at the top of the label

<hibou_print_tspl_bar_code>20|70|90|0|<hibou_print_bar_code_value>
// Print the product barcode

<hibou_print_tspl_add_text>330|80|2|90|1|1|<hibou_print_products_price>
//Print the product price in vertical after the barcode

<hibou_print_tspl_add_text>360|80|2|90|1|1|EUR
//Print the euro currency sign in vertical under your product price

<hibou_print_tspl_end_format>
//End code

7/ Go further : box and strike out a price

The variables for a box (<hibou_print_tspl_add_box>) are :
– the position from the top left corner(X and Y in dots),
– the position from the down right corner(X and Y in dots),
– the border thickness (in dots between 1 and 10),
– and the corner-rounding (between 0 and 8, 0 is no rounding)

Example :

<hibou_print_tspl_add_box>50|50|250|90|1|0

to create a black square-corner box with 200 dots width and 40 dots height.

To strike out a price, we superpose a one-line box over the price. The box height will have the same value as the box border thickness.

Exemple :

<hibou_print_tspl_add_text>250|70|3|0|1|1|<hibou_print_products_price> EUR  
<hibou_print_tspl_add_box>240|83|290|83|1|0

Send us a request

Click here

  • FR +33 (0)1 48 78 40 06
  • FR +41 (0)21 519 00 17
  • FR +32 (0)2 318 82 77
  • FR +34 (0)912 69 39 94