Configure labels

To print labels automatically from your account, you must use a ZPL (Zebra Programming Language) compatible label printer.
In 'Settings/Printing/Labels', you can select your label layout from a selection of labels in sizes 2"x1" or 1.25"x1" (resolution of 203 dpi or 8pts/mm).
But you can also 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_zpl_products_id>,
– the product name : <hibou_print_zpl_products_name>,
– the product category : <hibou_print_zpl_products_category>,
– the product price : <hibou_print_zpl_products_price> ,
– the product price without decimals : <hibou_print_zpl_products_price_round_0>,
– the product price with 2 decimals : <hibou_print_zpl_products_price_round_2>,
– the product price weighted by the multiple : <hibou_print_zpl_products_price_weighted>,
– the product discount price : <hibou_print_zpl_products_discount_price>,
– the account currency: <hibou_print_zpl_currency>,
– the product supplier code : <hibou_print_zpl_products_ref_manufacturer>,
– the product brand : <hibou_print_zpl_products_brand>,
– the product variation : <hibou_print_zpl_products_size>,
– the product storage location: <hibou_print_zpl_products_storage_location>,
– the product short name: <hibou_print_zpl_products_short_name>,
– the product barcode <hibou_print_zpl_bar_code> (see part 3),
– the product QR code <hibou_print_zpl_products_qr_code> (see part 4),
– and any free text.


2/ Encode a text content

For text content (<hibou_print_zpl_add_text>), you must set the following variables in this order :
– the position (X and Y in dots),
– the font (A to Z or 0 to 9),
– the font size (in dots),
– the text direction (N for horizontal, R for vertical, I horizontal inverted, B pour vertical inverted),
– the font height (in dots),
– the font width (by default you can set the same value as font height).
Variables are separated by pipes (|).

Example :

<hibou_print_zpl_add_text>20|10|D|N|30|30|<hibou_print_zpl_products_price>  <hibou_print_zpl_currency>

<hibou_print_zpl_add_text> means we are printing a text content, 20|10 are X and Y positions of the text, D is the D font of the printer, N to print the text horizontally, 30|30 are the heigth and width of the font, and <hibou_print_zpl_products_price> <hibou_print_zpl_currency> means we want to print the product price followed by the currency sign of the account.

If your text content is long you can truncate it with the following codes : <hibou_print_zpl_cut_start> and <hibou_print_zpl_cut_end> Exemple :

<hibou_print_zpl_products_name>|<hibou_print_zpl_cut_start>0</hibou_print_zpl_cut_start>||<hibou_print_zpl_cut_end>20</hibou_print_zpl_cut_end>|  

will only print the first 20 characters of the product name.


3/ Encode a barcode

For barcodes (<hibou_print_zpl_bar_code>), you must set the following variables in this order :
– the position (X and Y in dots),
– the direction (N for horizontal, R for vertical, I horizontal inverted, B pour vertical inverted),
– the height (in dots between 1 and 32000),
– the display of barcode numbers (Y for yes or N for no),
– the position of barcode numbers (N if below the code, Y if above the code).

Example :

<hibou_print_zpl_bar_code>20|300|N|10|Y|N

<hibou_print_zpl_bar_code> means we are printing a barcode,
20|300 are X and Y positions of the barcode,
N to print the barcode in horizontal,
10|Y|N means the barcode will have 10 dots height, and barcode numbers are displayed below the code.


4/ Encode a QR code

For QR codes (<hibou_print_zpl_products_qr_code>), you must set the following variables in this order :
– the position (X and Y in dots),
– the model (1 for normal or 2 for enhanced – recommended),
– the size (from 1 to 10),
– the accuracy level (H for ultra-hight, Q for hight, M for standard, L for low level),
– the mask value (from 0 to 7).

Example :

<hibou_print_zpl_products_qr_code>20|50|2|5|M|7|https://www.hiboutik.com

<hibou_print_zpl_products_qr_code> means we are printing a QR code,
20|50 are X and Y positions of the QR code,
0|2|5|M|7 are the specific settings of the QR code,
and then the content to encode (the hiboutik website in this example).


5/ An example

Here is the code for the following label:

<hibou_print_zpl_start_format>
//Open code

<hibou_print_zpl_add_text>20|25|D|N|10|10|<hibou_print_zpl_products_name>
//Print the product name at the top of the label

<hibou_print_zpl_bar_code>20|70|N|80|Y|N
// Print the product barcode

<hibou_print_zpl_add_text>330|80|D|B|16|10|<hibou_print_zpl_products_price>
//Print the product price in vertical after the barcode

<hibou_print_zpl_add_text>360|80|D|B|16|10|EUR
//Print the euro currency sign in vertical under your product price

<hibou_print_zpl_end_format>
//End code

6/ Go further : box and strike out a price

The variables for a box (<hibou_print_zpl_add_box>) are :
– the position (X and Y in dots),
– the width (in dots between 1 and 32000),
– the height (in dots between 1 and 32000),
– the border thickness (in dots between 1 and 32000),
– the box line color (B for black and W for white),
– and the corner-rounding (between 0 and 8, 0 is no rounding)

Example :

<hibou_print_zpl_add_box>50|100|200|40|4|B|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.

Example :

<hibou_print_zpl_add_text>250|70|D|N|16|10|<hibou_print_zpl_products_price> EUR  
<hibou_print_zpl_add_box>240|83|150|2|2|B|0