Skip to content
DE EN
Docs navigation

Objects & commands

Template Editor Part 2, Text, prices, barcodes and the multi-item trick

Advanced · approx. 18 min read

Based on ESLEasy_TemplateEditor V2.7, as of 2025-09-03

Prerequisites

  • Guide “Your first template in 15 minutes” completed
  • A template with test data is available

About 30 commands are available in the Template Editor. This guide explains the conventions that apply to all of them, and walks through the commands you need most often in practice.

First: the conventions

Before you learn individual commands, learn the rules that apply to all of them. That saves more time than any command list.

The command format

Every command stands in its own template line:

<CMD="BEFEHL"><PARAMETER="Wert"><PARAMETER="Wert">…

For each command you can additionally specify a WHEN condition (see Guide 4).

Color values

All color parameters (COLOR, BGCOLOR, FORECOLOR, BACKCOLOR, TEXTCOLOR, COLOREDGE, …) accept two notations:

  • Constant: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE
  • RGB value: R,G,B, e.g. 255,0,0

On ESL labels, only use colors supported by the label. A label that only supports black/white/red will not render CYAN.

The two rules of thumb

Without THICKNESS, no border is drawn. Without BGCOLOR, there is no fill.

If a rectangle “does not appear”, one of these two parameters is almost always missing.

Further common values

ConventionValues
STYLE (border/line style)DASH, DASHDOT, DASHDOTDOT, DOT, SOLID
POSITION / ROTATIONPOINT (9-point grid)UPPERLEFT, UPPERCENTER, UPPERRIGHT, CENTERLEFT, CENTERCENTER, CENTERRIGHT, LOWERLEFT, LOWERCENTER, LOWERRIGHT
Line ends (CAP)ARROWANCHOR, DIAMONDANCHOR, FLAT, NOANCHOR, ROUND, ROUNDANCHOR, SQUARE, SQUAREANCHOR, TRIANGLE
Data field access{Datenfeld}, alternatively [DATAVALUE~Datenfeld] (see Guide 4)

Documentation quirk for rotation angle: The original documentation writes the rotation-angle parameter for most commands as ANGEL, but for ATEXT and COCKPITCHART as ANGLE. This is not a typo in this guide, but the actually different spelling per command. Use the spelling documented for the specific command.

Source: ESLEasy_TemplateEditor V2.7, “Common value conventions”, Part 2 (command reference), from p. 26.


CANVAS, the foundation of every template

CANVAS defines the template resolution in pixels. The values must match the physical label values.

ParameterExplanation
WIDTHWidth in points
HEIGHTHeight in points
ROTATERotation when transferring to the label, in degrees. Valid: 0, 90, 180, 270
<CMD="CANVAS"><WIDTH="640"><HEIGHT="960"><ROTATE="90">

You normally set these values via the Config dialog (see Guide 2), but you can change them directly in the source code at any time.

What is ROTATE for? If a portrait template is created for a label that is physically landscape-oriented, the image must be sent rotated. On the MDE device, only templates with a matching resolution are offered (exception: “All” is selected explicitly). Check whether the rotation is correct in the preview, not in the graphical editor.

screenshot201.png
A portrait template with ROTATE=90, left the editor, right the preview with the actual output

Source: V2.7, CANVAS, p. 26.


TEXT, the most important object

TEXT is the command you use most often, and at the same time the most complex. Once you master TEXT, you understand the pattern of all other commands.

<CMD="TEXT"><Y="36"><X="0"><WIDTH="640"><HEIGHT="100"><TEXT="{ARTIKELBEZEICHNUNG 1}"><COLOR="BLACK"><FONT="Segoe UI"><FONTSIZE="40"><BOLD="FALSE"><CENTER>
screenshot202.png
A TEXT object with linked data field, source code and graphical representation

Position and border

ParameterExplanation
X, YPosition
WIDTH, HEIGHTBounding box (max. width/height)
COLORText color
BGCOLORBackground color

The text content

ParameterExplanation
TEXTText to output. ~ is translated into a line break. Data fields with {Datenfeld}
FILEText is loaded from the specified file

Truncating and clipping text

These parameters save layouts when ERP data is longer than planned again:

ParameterExplanation
MAXLENGTHMax. number of characters. Longer text is truncated; “…” or MAXLENGTHTEXT is appended
MAXLENGTHTEXTText appended on overflow (default: “…”)
LEFTLENGTH / LEFTTEXTOutput only the specified number of characters from the left
RIGHTLENGTHOutput only the specified number of characters from the right
SUBSTRINGPartial output: start position and character count with comma. <SUBSTRING="3,5"> = 5 characters starting after the third position
LTRIMTrim leading spaces

Font and alignment

ParameterExplanation
FONT / FONTSIZEFont name (installed fonts) / font size
BOLD / ITALIC / REGULAR / STRIKEOUT / UNDERLINEFont style
CENTER / RIGHTHorizontally centered / right-aligned in the area
POSITIONPosition in the box (9-point grid)
WORDWRAPAutomatic word wrap in the area
AUTOSIZEAutomatically fit font size to the area
MINFONTSIZELower limit for AUTOSIZE, what still does not fit is truncated
MAXFONTSIZEUpper limit for AUTOSIZE
DATEFORMAT / TIMEFORMATDate/time format (otherwise default, see Guide 4)
ANGELRotation angle of the text

AUTOSIZE + MINFONTSIZE is the combination for variable item names. The font shrinks until the text fits, but not below the readability limit you set.

screenshot203.png
AUTOSIZE in action: The same text frame with a short and a long item name

Source: V2.7, TEXT, p. 29–31.


ATEXT, multiple formats in one text

ATEXT (Attribute Text) allows different formats within one text, fonts, sizes, colors, styles, via embedded control commands. The general TEXT parameters apply for overall formatting.

Control commands are opened and closed with two underscores:

Control commandExplanation
__COLOR:Farbe__Text color, e.g. __COLOR:RED__ or __COLOR:255,0,0__
__STYLE:Stil__BOLD, ITALIC, REGULAR, STRIKEOUT, UNDERLINE, combinable (e.g. ITALICBOLD)
__FONT:Fontname,Fontgröße,Fontstyle__Full font change mid-text
__BASE:Pixel__Vertical shift of the following text in pixels

Additional ATEXT parameters: ANGLE (rotation angle, here with “L”!), ROTATIONPOINT, LEFT/CENTER/RIGHT, JUSTIFICATION (justified), BGCOLOR and BGDISTANCE (border width of the background color).

Source: V2.7, ATEXT, p. 55–57. BGCOLOR and BGDISTANCE were added with version 2.5.


PRICE, the price as its own object

There is a dedicated command for prices. It delivers offset, scalable, optionally underlined decimal places and an optional currency symbol, exactly the typical price-tag layout that you could rebuild with TEXT only with difficulty.

<CMD="PRICE"><X="0"><Y="0"><WIDTH="200"><HEIGHT="100"><TEXT="99.95"><TEXTCOLOR="BLACK"><FONT="Calibri"><FONTSIZE="50"><NSCALE="50"><NOFFSETY="-40"><WAEHRUNG="€"><WSCALE="70"><WOFFSETX="20"><WOFFSETY="-20">
screenshot204.png
The PRICE object: Decimal places and currency symbol can be scaled and positioned independently
ParameterExplanation
TEXTPrice value to output
TEXTCOLORText color
BACKCOLORBackground color of the price field
KOFFSETXDistance of the decimal separator from the main price (negative or positive)
NSCALEScale factor of the decimal places
NOFFSETX / NOFFSETYDistance of the decimal places from the main price
WAEHRUNGCurrency symbol (e.g. )
WSCALEScale factor of the currency symbol
WOFFSETX / WOFFSETYDistance of the currency symbol from the main price
IMAGE / IMAGEBASE64Image overlaid on the price field, e.g. a strikethrough graphic
IMAGETRANSPARENTRender overlay image with transparent background
RIGHTPrice right-aligned
ROTATERotation angle of the price field

The strikethrough trick: Via IMAGE you place a graphic over the price field. Combined with a WHEN condition (Guide 4), this becomes the classic struck-through list price in a promotion case.

Source: V2.7, PRICE, p. 49–51.


BARCODE, QRCODE, DATAMATRIX

BARCODE

<CMD="BARCODE"><Y="0"><X="0"><TYPE="EAN13"><TEXT="978020137962"><SIZE="150"><WIDTH="200"><HEIGHT="50">
ParameterExplanation
TYPEBarcode type, incl. EAN13, EAN8, CODE128, CODE39, CODE93, ITF14, UPCA, UPCE, ISBN, CODABAR, PHARMACODE, POSTNET (the docs list more than 30 types)
TEXTBarcode data
FORECOLOR / BACKCOLORColor of the bars / of the background
LABELShows the barcode text below the barcode
ROTATE0, 90, 180, 270
FLIPMirror: X, Y or XY
IGNOREERRORSIgnore errors, if the linked data do not form a valid barcode, the barcode is omitted on the label

IGNOREERRORS is a practical lifesaver: If a single item in the ERP has an incomplete EAN, label generation aborts without this parameter. With it, the label remains, only the barcode is missing.

screenshot205.png
An EAN13 barcode with LABEL text shown

QRCODE

<CMD="QRCODE"><Y="0"><X="0"><WIDTH="75"><TEXT="www.esl-easy.de"><QUITEZONES="ZERO">
ParameterExplanation
WIDTHWidth and height of the QR code
TEXTText to display
QUITEZONESQuiet zone: ZERO (no margin, default), TWO (margin size 1), FOUR (margin size 2)
ERRORCORRECTIONLEVELError correction: H, L, M, Q

QRCODE_VCARD creates a QR code as a vCard, smartphones recognize it as a contact and store it. The vCard fields (NAME, FIRSTNAME, TEL_CELL, EMAIL_WORK, URL, STREET, ORG, …) are passed directly as parameters; unused tags can be omitted. Without specifying VCARD_TEMPLATE, the supplied default template vCard.txt is used.

DATAMATRIX

<CMD="DATAMATRIX"><Y="10"><X="10"><WIDTH="75"><HEIGHT="75"><TEXT="www.esl-easy.de">

Additional parameters: MARGINSIZE (margin size), MODULSIZE (size/quality of the code) and SCHEME (Data Matrix scheme per ISO, ASCII is default, further: ASCIGS1, AUTOBEST, AUTOFAST, BASE256, C40, EDIIFACT, TEXT, X12).

Source: V2.7, BARCODE p. 43–45; DATAMATRIX p. 45–46; QRCODE p. 47; QRCODE_VCARD p. 47–49. DATAMATRIX was added with version 2.5.


IMAGE, embedding graphics

Supported formats: PNG, JPG, BMP, GIF, TIF, TIFF, WMF.

<CMD="IMAGE"><Y="215"><X="170"><HEIGHT="38"><WIDTH="150"><FILE="ESL-Easy.PNG">
ParameterExplanation
FILEImage from file
BASE64Image in BASE64 format
WIDTHMAX / HEIGHTMAXSets width/height of the graphic to the label size
STRETCHScale graphic to the specified area
CENTER / TOP / BOTTOM / RIGHT / LEFTAlignment in the area
NOTTRANSPARENTDo not render graphic transparently (e.g. PNG)
GREYSCALEConvert to black and white
ROTATERotate graphic
INVERTInvert graphic
INVERTBWInvert only the black/white portion, color portions (e.g. red) remain unchanged
INVERTBWTOLERANCEValue 0–255: deviation from pure black (0) or white (255) that is still interpreted as black/white

INVERTBW is specifically intended for color e-ink: A logo can be inverted without the red portions flipping as well.

Source: V2.7, IMAGE, p. 32–33.


The WIDTH/HEIGHT trap

For IMAGE, BARCODE, QRCODE, QRCODE_VCARD and PRICE, WIDTH and HEIGHT must be greater than 0 in the source code, otherwise these objects cannot be drawn.

This is the most common cause of “my barcode does not appear”. No error, no red line, the object is simply missing.


OFFSET & LAYER, the multi-item trick

This is the technique that turns a price tag into a shelf label with four items, without you having to recalculate a single coordinate.

The problem

You have built a finished item block: name, price, unit price, barcode. Now four of them should go one under another on the label. Manually that would mean: copy all lines, adjust all Y coordinates on every copy and change the layer on every data field. With four items and six objects that is 24 manual changes.

The solution in two commands

OFFSET shifts the origin for all following objects. Object position is then: own X/Y value + OFFSET.

<CMD="OFFSET"><Y="150">
<CMD="OFFSET"><X="250"><Y="150">
<CMD="OFFSET"><Y="-75">

LAYER sets the data-field layer for all following data fields, instead of appending a _2 suffix to every single field.

<CMD="LAYER"><LEVEL="2">   → {DESCRIPTION} becomes {DESCRIPTION_2} internally
<CMD="LAYER"><LEVEL="1">   → Reset: the specification in the source code applies again

The recipe

  1. Build and position one item block cleanly.
  2. Copy the source-code lines of the block and paste them below.
  3. Place an OFFSET before the copy, the block moves entirely to its new position.
  4. Also place a LAYER with the next layer before the copy, the block now shows the next item.
  5. Repeat.

No coordinate is touched. No data field is renamed.

screenshot206.png
Four identical item blocks, created by pure copying plus OFFSET and LAYER

Where do the layers come from? When multiple items are output on one label, multiple DataIDs must be retrieved. Because field names are the same per DataID, ESL-Easy splits the data into layers: The data of the second query land as the 2nd layer in the payload, recognizable by the suffix _2 ({PREIS_2}). LAYER is the convenient alternative to the suffix. Do not forget to store the matching number of DataIDs in LINKEDDATAIDS (see Guide 2).

Documentation quirk: The parameter table in the original documentation accidentally writes the LAYER parameter as “LAVEL”. The examples in the docs, and the actual syntax, use LEVEL. If you look it up in the PDF: do not be misled.

Source: V2.7, OFFSET p. 28; LAYER p. 28–29; “Multiple DataIDs on one label” p. 16–17.


Dynamic alignment, objects that orient to each other

Sometimes a fixed position is not enough: The price should stand under the item name, regardless of how tall the name actually becomes after AUTOSIZE and WORDWRAP.

How it works

An object receives a name:

<NAME="Object1">

Every subsequent object can then access its parameters.

Order matters: An object must already have been drawn in the source code for another object to access its data. Forward references do not work.

The commands

CommandEffect
ADDXFROM / SUBXFROMAdds/subtracts attributes to/from the X coordinate
ADDYFROM / SUBYFROM… to/from the Y coordinate
ADDWIDTHFROM / SUBWIDTHFROM… to/from WIDTH
ADDHEIGHTFROM / SUBHEIGHTFROM… to/from HEIGHT
ADDTOXFROM / SUBTOXFROM… to/from TOX (for lines)
ADDTOYFROM / SUBTOYFROM… to/from TOY (for lines)

Structure: <Befehl, @Objektname, Parameter, Parameter, @Objektname, Parameter, …>

Examples

<ADDYFROM="@OBJECT1,Y,HEIGHT">

Adds the values Y and HEIGHT of OBJECT1 to its own Y. Calculation: Own <Y="10">, OBJECT1 has <Y="20"> and <HEIGHT="10">Y = 40 (10 + 20 + 10). The object thus sits exactly under OBJECT1, no matter how tall OBJECT1 becomes.

<ADDYFROM="@OBJECT1,Y,HEIGHT,@OBJECT2,Y,HEIGHT">

Access to multiple objects: first object name, then its parameters, then the next object.

<ADDXFROM="@OBJECT1,Y,WIDTH,20">

Instead of parameters, fixed numbers are also possible, here an additional 20 points are added.

<ADDXFROM="PRICE">

Only an object name: The attribute matching the command is used (here the X of the object PRICE).

<ADDXFROM="-100">

Only a number, equivalent to <SUBXFROM="100">.

Two pitfalls:

  1. You do not see the result in the graphical editor. Dynamic adjustments are, for technical reasons, only rendered correctly in the preview. Do not be surprised if everything looks shifted in the editor.
  2. For IMAGE, BARCODE, QRCODE, QRCODE_VCARD and PRICE, WIDTH/HEIGHT must still be greater than 0 in the source code. If a dependency refers directly to another object, WIDTH or HEIGHT must be subtracted again.
screenshot207.png
Dynamic alignment: The graphical editor (left) does not show it, only the preview (right) delivers the real result

Source: V2.7, “Dynamic alignment of objects”, Part 2 of the command reference.


Further useful commands

CHECKDATA, protect the user from the wrong template

Checks the payload for whether it matches the current template. Relevant when there are multiple templates per label type.

<CMD="CHECKDATA"><FIELD="WGR"><VALUE="10"><COMPARISON="UNEQUAL"><MESSAGE="Artikel und Template passen nicht zur Produktgruppe WEIN. Soll die Verknüpfung trotzdem erfolgen?"><ACTION="YESNO">
ParameterExplanation
FIELDData field to check
VALUEComparison value
VALUESAND / VALUESORMultiple values with comma, all or at least one must match
COMPARISIONEQUAL, UNEQUAL, CONTAINS (InString comparison)
MESSAGEMessage text on negative check
ACTIONYESNO (user decides), OK (confirm only, link continues), CANCEL (confirm only, link is aborted)

Documentation quirk: The parameter table writes COMPARISION, the example in the docs uses COMPARISON. Both spellings appear in the original, when in doubt, test the behavior.

PARAM, label-specific values

Defines parameters that the user sets individually for the current label at linking time, e.g. a direction arrow that should appear only on this one label, even if further labels show the same item data.

<CMD="PARAM"><NAME="PFEIL"><VALUES="OHNE;OBEN;RECHTS;UNTEN;LINKS">
  • VALUES, Preset values, separated by semicolon. If VALUES remains empty, the user can enter free text.
  • GROUP, groups the parameters on the mobile device with a group heading.
  • LOCATIONINCLUSION / LOCATIONEXCLUSION, in which locations the parameter is shown.

Such values cannot come from external data; they are stored directly against the label ID. Access in the template is like normal payload data: {PFEIL}.

screenshot208.png
Label parameters: The user chooses individually at linking time, here the arrow direction

LOCATION, control template visibility

Restricts the visibility of the template in the template selection:

<CMD="LOCATION"><INCLUSION="1"><EXCLUSION="">

INCLUSION = location numbers (comma-separated) in which the template is shown. EXCLUSION = locations in which it is not shown.

NFC, write data to the label chip

The command differs by manufacturer:

Ontime, simple:

<CMD="NFC"><NFC_URL="http://www.esl-easy.de">

A URL is opened automatically by the smartphone after reading.

Hanshow, with public and private area:

<CMD="NFC"><URI_STANDARD="{URI_STANDARD}"><URI_PRIVATE="{URI_PRIVATE}"><NFC_KEY="GeheimerKey"><TAG_PERMISSION="READONLY"><APP_PERMISSION="READWRITE">

Data in the public area (URI_STANDARD, TEXT_STANDARD) are readable with all common NFC readers, e.g. the customer smartphone. Storage is in NDEF format. To read the private area (URI_PRIVATE, TEXT_PRIVATE), special HANSHOW software is required; NFC_KEY is a 16-character key (shorter texts are padded with spaces at the front).

Documentation quirk: The Hanshow parameter table once writes TAG_PERMISSSION (with three S); the example uses TAG_PERMISSION.

BARGRAPH, bars and progress indicators

<CMD="BARGRAPH"><Y="10"><X="10"><WIDTH="20"><HEIGHT="100"><COLOR="BLACK"><BARCOLOR="RED"><PERCENT="20"><THICKNESS="1"><BARPOSITION="LOWER">

PERCENT specifies the fill level, BARPOSITION the draw direction (LEFT, UPPER, RIGHT, LOWER, default is LOWER, i.e. from bottom to top). BARSTYLE offers more than 50 fill patterns.

Documentation quirk: The parameter table names BGCOLOR as fill color, the example in the docs uses BARCOLOR for the bar color. If one spelling does not work, try the other.

Source: V2.7, CHECKDATA p. 53–54; PARAM p. 54–55; LOCATION p. 53; NFC p. 51–52; BARGRAPH p. 41–43.


What this guide does not cover

The command reference comprises about 30 commands. Among others, the following were not covered:

  • Drawing objects: LINE, RECTANGLE, ELLIPSE, POLYGON, PIE, ARC, COCKPITCHART
  • FONT, creates a font for subsequent commands (usually not needed, because the font is specified per command)
  • BACKGROUNDCOLOR, background color of the template (default: WHITE)
  • Format files (.fmt), can be created for each graphic file
  • PAGE, multiple views per label (see Guide 4)

Full reference: Original PDF ESLEasy_TemplateEditor 2.7_EN, p. 26–61.


Further reading

Source document: Template Editor · v2.7