Full specification and documentation for the Thermoprint template engine.
In thermal label printing and asset tagging, floating-point decimal fractions do not exist. Expressions like 1.01, 1/01, or 1,01 are not mathematical numbers, but positional stencils (masks) where non-numeric characters serve as fixed anchor slots, and embedded digits form an integer counter.
- Stencil Skeleton: All non-digit characters (letters, hyphens, dots, commas, slashes, spaces,
#,β) remain fixed at their original positions as an immutable skeleton. - Digit Extraction: All digits within the pattern are extracted into a single starting integer. Their count determines the minimum padding width (leading zeros).
- Integer Arithmetic: The engine increments or decrements the extracted integer by the configured step for each subsequent printed label.
- Slot Refill: The resulting number is formatted back into the original digit slots of the stencil skeleton.
SN-0001β SkeletonSN-____, digits0001advance:SN-0002,SN-0003...1.01or1/01β Skeleton_.__, digits101become102(1.02), and after1.99naturally roll over to2.00!- Arbitrary starting values: start from
1,100,050, or0001β the exact expression entered prints on the 1st label (WYSIWYG).
flowchart LR
subgraph Stencil["1. Positional Stencil"]
P["Input: 'SN-0001+1'"] --> S["Skeleton: 'SN-____'"]
P --> D["Digits: 0001 (Width: 4)"]
end
subgraph Step["2. Integer Stepping"]
D --> INC["Step: +1 per label"]
INC --> N1["Step 1: 0001"]
INC --> N2["Step 2: 0002"]
INC --> N3["Step 3: 0003"]
end
subgraph Output["3. Formatted Labels"]
S & N1 --> L1["Label 1: SN-0001"]
S & N2 --> L2["Label 2: SN-0002"]
S & N3 --> L3["Label 3: SN-0003"]
end
Expressions inside double curly braces {{...}} follow a strict binary rule:
| Expression | Type | Source | Examples |
|---|---|---|---|
{{#:...}} |
Autonomous Counter | Evaluated on every print step. Self-contained, does NOT require CSV. | {{#:1}}, {{#:001}}, {{#:SN-001+5}}, {{#:100+-1}} |
{{...}} |
Table Column (CSV) | Replaced with the corresponding column value from the loaded CSV/TSV file for that row. | {{Field name}}, {{SKU}}, {{Price}}, {{Barcode}} |
Note
The colon in {{#: guarantees that if your spreadsheet has a column named # or ## (e.g. row index in Excel), you can safely reference it as {{#}} or {{##}} without conflicting with counters.
The number of digits in the starting value defines the minimum width:
{{#:1}}β1,2,3...9,10(no padding){{#:01}}β01,02,03...99,100(minimum 2 digits){{#:001}}β001,002,003...999,1000(minimum 3 digits){{#:0001}}β0001,0002...9999,10000(minimum 4 digits)
Note: When a counter exceeds its initial digit count, it does not truncate β it naturally expands (99 β 100).
Counters do not have to start at 1 or 0:
{{#:100}}β 1st label100, then101,102...{{#:050}}β 1st label050, then051,052...{{#:2026-001}}β 1st label2026-001, then2026-002...
- Default:
+1increment when no operator is specified. - Custom Increment (
+N):{{#:1+5}}β1,6,11,16...{{#:000+10}}β000,010,020,030...
- Countdown / Decrement (
+-N):{{#:100+-1}}β100,99,98...{{#:05+-1}}β05,04,03,02,01,00.- Zero-Guard Print Halt: When counting down, reaching
< 0immediately halts printing. Thermal printers never produce negative labels.
Important
Why +- instead of a plain minus -? A single hyphen - is a common text character in part numbers (SN-001) and dates (2026-01). To eliminate ambiguity between hyphens in names and subtraction, countdown sequences require +-.
| Expression | 1st Label | 2nd Label | 3rd Label | Behavior |
|---|---|---|---|---|
{{#:1}} |
1 |
2 |
3 |
Start at 1, step +1 |
{{#:0001}} |
0001 |
0002 |
0003 |
4 digits with leading zeros |
{{#:100}} |
100 |
101 |
102 |
Start from 100 |
{{#:001+5}} |
001 |
006 |
011 |
Start at 001, step +5 |
{{#:100+-1}} |
100 |
99 |
98 |
Countdown (halts at 0) |
{{#:SN-0001}} |
SN-0001 |
SN-0002 |
SN-0003 |
Fixed SN- prefix |
{{#:1.01}} |
1.01 |
1.02 |
1.03 |
Hierarchical dot separator (rolls over 1.99 β 2.00) |
{{#:1/01}} |
1/01 |
1/02 |
1/03 |
Slash separator (rolls over 1.99 β 2.00) |
{{#:Box #01}} |
Box #01 |
Box #02 |
Box #03 |
Spaces and # preserved as text |
{{#:BOX-001-A}} |
BOX-001-A |
BOX-002-A |
BOX-003-A |
Fixed prefix and suffix |
{{#:###}} |
###1 |
###2 |
###3 |
# is literal text, not a mask character |
Syntax: {{Field name}}
Substitutes the runtime value from the matching column header of the loaded file:
- If column is
SKUβ{{SKU}} - If column is
Priceβ{{Price}} - If column is
Barcodeβ use{{Barcode}}inside a Barcode or QR element
- Auto Delimiter Detection: Sniffs comma (
,), semicolon (;), and tab (\t, TSV). - RFC 4180 Escaping: Full support for quoted fields containing commas or newlines (
"Text, with comma"). - UTF-8 BOM Stripping: Excel UTF-8 CSV exports load cleanly without byte-order mark corruption.
You can freely mix counters, CSV fields, static text, and date variables ([[DD.MM.YYYY]]) in any text, barcode, or QR code element:
{{Category}} / #{{#:001}}
SKU: {{SKU}}
Date: [[DD.MM.YYYY]]
Price: {{Price}} EUR
Use the status bar < / > pagination controls to preview actual interpolated values live on canvas before printing.
flowchart TD
subgraph Data["1. Data Layer"]
CSV["Spreadsheet (CSV/TSV)"]
CTR["Autonomous Counter ({{#:...}})"]
TPL["Canvas Template (WYSIWYG)"]
end
subgraph Batch["2. Batch Processing"]
RNG["Range Filter (e.g. 1-50, 99)"]
SAN["Sanity Check Confirmation Table"]
DYN["Dynamic Tape Length Re-fit (Continuous Mode)"]
end
subgraph Hardware["3. Print Execution"]
GATT["BLE Transport (Credit-Based Flow Control)"]
PRN["Thermal Printer (Phomemo / Marklife)"]
end
CSV & CTR & TPL --> RNG
RNG --> SAN
SAN --> DYN
DYN --> GATT
GATT --> PRN