Docs navigation
No results. You may also check the FAQ.
Objects & commands
Template Editor Part 2, Text, prices, barcodes and the multi-item trick
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
| Convention | Values |
|---|---|
| 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.
| Parameter | Explanation |
|---|---|
WIDTH | Width in points |
HEIGHT | Height in points |
ROTATE | Rotation 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.
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>
Position and border
| Parameter | Explanation |
|---|---|
X, Y | Position |
WIDTH, HEIGHT | Bounding box (max. width/height) |
COLOR | Text color |
BGCOLOR | Background color |
The text content
| Parameter | Explanation |
|---|---|
TEXT | Text to output. ~ is translated into a line break. Data fields with {Datenfeld} |
FILE | Text is loaded from the specified file |
Truncating and clipping text
These parameters save layouts when ERP data is longer than planned again:
| Parameter | Explanation |
|---|---|
MAXLENGTH | Max. number of characters. Longer text is truncated; “…” or MAXLENGTHTEXT is appended |
MAXLENGTHTEXT | Text appended on overflow (default: “…”) |
LEFTLENGTH / LEFTTEXT | Output only the specified number of characters from the left |
RIGHTLENGTH | Output only the specified number of characters from the right |
SUBSTRING | Partial output: start position and character count with comma. <SUBSTRING="3,5"> = 5 characters starting after the third position |
LTRIM | Trim leading spaces |
Font and alignment
| Parameter | Explanation |
|---|---|
FONT / FONTSIZE | Font name (installed fonts) / font size |
BOLD / ITALIC / REGULAR / STRIKEOUT / UNDERLINE | Font style |
CENTER / RIGHT | Horizontally centered / right-aligned in the area |
POSITION | Position in the box (9-point grid) |
WORDWRAP | Automatic word wrap in the area |
AUTOSIZE | Automatically fit font size to the area |
MINFONTSIZE | Lower limit for AUTOSIZE, what still does not fit is truncated |
MAXFONTSIZE | Upper limit for AUTOSIZE |
DATEFORMAT / TIMEFORMAT | Date/time format (otherwise default, see Guide 4) |
ANGEL | Rotation 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.
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 command | Explanation |
|---|---|
__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">
| Parameter | Explanation |
|---|---|
TEXT | Price value to output |
TEXTCOLOR | Text color |
BACKCOLOR | Background color of the price field |
KOFFSETX | Distance of the decimal separator from the main price (negative or positive) |
NSCALE | Scale factor of the decimal places |
NOFFSETX / NOFFSETY | Distance of the decimal places from the main price |
WAEHRUNG | Currency symbol (e.g. €) |
WSCALE | Scale factor of the currency symbol |
WOFFSETX / WOFFSETY | Distance of the currency symbol from the main price |
IMAGE / IMAGEBASE64 | Image overlaid on the price field, e.g. a strikethrough graphic |
IMAGETRANSPARENT | Render overlay image with transparent background |
RIGHT | Price right-aligned |
ROTATE | Rotation 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">
| Parameter | Explanation |
|---|---|
TYPE | Barcode type, incl. EAN13, EAN8, CODE128, CODE39, CODE93, ITF14, UPCA, UPCE, ISBN, CODABAR, PHARMACODE, POSTNET (the docs list more than 30 types) |
TEXT | Barcode data |
FORECOLOR / BACKCOLOR | Color of the bars / of the background |
LABEL | Shows the barcode text below the barcode |
ROTATE | 0, 90, 180, 270 |
FLIP | Mirror: X, Y or XY |
IGNOREERRORS | Ignore 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.
QRCODE
<CMD="QRCODE"><Y="0"><X="0"><WIDTH="75"><TEXT="www.esl-easy.de"><QUITEZONES="ZERO">
| Parameter | Explanation |
|---|---|
WIDTH | Width and height of the QR code |
TEXT | Text to display |
QUITEZONES | Quiet zone: ZERO (no margin, default), TWO (margin size 1), FOUR (margin size 2) |
ERRORCORRECTIONLEVEL | Error 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">
| Parameter | Explanation |
|---|---|
FILE | Image from file |
BASE64 | Image in BASE64 format |
WIDTHMAX / HEIGHTMAX | Sets width/height of the graphic to the label size |
STRETCH | Scale graphic to the specified area |
CENTER / TOP / BOTTOM / RIGHT / LEFT | Alignment in the area |
NOTTRANSPARENT | Do not render graphic transparently (e.g. PNG) |
GREYSCALE | Convert to black and white |
ROTATE | Rotate graphic |
INVERT | Invert graphic |
INVERTBW | Invert only the black/white portion, color portions (e.g. red) remain unchanged |
INVERTBWTOLERANCE | Value 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
- Build and position one item block cleanly.
- Copy the source-code lines of the block and paste them below.
- Place an
OFFSETbefore the copy, the block moves entirely to its new position. - Also place a
LAYERwith the next layer before the copy, the block now shows the next item. - Repeat.
No coordinate is touched. No data field is renamed.
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
| Command | Effect |
|---|---|
ADDXFROM / SUBXFROM | Adds/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:
- 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.
- For
IMAGE,BARCODE,QRCODE,QRCODE_VCARDandPRICE,WIDTH/HEIGHTmust still be greater than 0 in the source code. If a dependency refers directly to another object,WIDTHorHEIGHTmust be subtracted again.
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">
| Parameter | Explanation |
|---|---|
FIELD | Data field to check |
VALUE | Comparison value |
VALUESAND / VALUESOR | Multiple values with comma, all or at least one must match |
COMPARISION | EQUAL, UNEQUAL, CONTAINS (InString comparison) |
MESSAGE | Message text on negative check |
ACTION | YESNO (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. IfVALUESremains 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}.
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
- Previous guide: Your first template in 15 minutes
- Next guide: Logic: WHEN, macros, formatting, conditional visibility, calculations and label parameters
Source document: Template Editor · v2.7