posprint Help
Built-in reference for the template editor and POS markup language.
---
Application tabs
| Tab | Purpose |
|---|---|
| Design | Side-by-side template editor and live preview |
| Help | This documentation |
Toolbar actions
| Action | Description |
|---|---|
| New | Empty template with defaults |
| Open | Load a .pos file |
| Save / Save As | Write .pos file (metadata + body) |
| Insert | Images, barcodes, QR, date/time, parameters, @feed, @cut |
| Enter parameters, pick a printer, send ESC/POS bytes |
While the Print dialog is open, the rest of the UI (including editor autocomplete) is disabled so parameter fields keep focus.
Editor assistance
- Type
@at the start of a line for directive autocomplete (feed,cut,image,barcode,qr,date,time). - Use Insert → Barcode / QR code to pick native or raster type before inserting a snippet.
Page settings
| Setting | Description |
|---|---|
| Page width (mm) | Paper width — match your physical roll (e.g. 53, 58, 80) |
| Preview zoom | Screen zoom; 100% is calibrated to typical receipt width on screen |
Preview width and text use the same calibrated screen scale. Preview font size is bumped to match printed Font A. Blank lines / @feed use the same line spacing as printed text. Heading # uses double width/height like GS ! on the printer; ## uses bold only.
If the document does not end with @cut (ignoring blank lines after it), a red warning appears next to Help.
---
Template language
A template is plain text: paragraphs, headings, lists, checkboxes, directives, and ${parameters}. There is no inline bold/italic/code markup — asterisks and backticks print literally.
Paragraphs
Consecutive non-empty lines form one paragraph.
Headings
# Large heading
## Bold heading
Alignment
:left:, :center:, or :right: before a paragraph.
Bullet lists
- first item
- second item
Long items wrap with a hanging indent (printed/previewed as ASCII *):
* this is a
long line
Parameters
| Syntax | Effect |
|---|---|
${Name} | Parameter (filled at print time) |
Checkboxes
Inline checkboxes (ASCII on print/preview):
| Syntax | Result |
|---|---|
[] or [ ] | Empty box [ ] |
[x] or [X] | Checked box [x] |
[] Unchecked
[ ] Also unchecked
[x] Done
Horizontal rule
---
Comments
<!-- not printed -->
---
Directives
Directives start with @ at the beginning of a line.
Paper feed / cut
@feed 3
@cut
Blank lines in the editor also feed one line (same as @feed 1).
Date / time
@date
@date DD-MM-YYYY
@time
@time 12h
@time 24h
@datewith no pattern uses the system regional short date.- Custom patterns use tokens such as
YYYY,MM,DD. @timedefaults to 24-hour; use12hor24h.
Image
@image logo.png
@image ${LogoPath} width=50% align=center
Barcode
Native (printer draws barcode via ESC/POS):
@barcode CODE128 ${OrderId}
@barcode UPC-A 012345678905
@barcode ITF 12345678 height=80
Raster (bitmap). Raster barcodes stretch horizontally to full paper width; height follows height.
@barcode RASTER CODE128 ${OrderId}
@barcode RASTER CODE93 ABC-1234
| Native symbology | Notes |
|---|---|
CODE128 | Alphanumeric |
EAN13, EAN8 | Numeric |
CODE39 | Alphanumeric |
UPC-A, UPC-E | Numeric |
ITF | Interleaved 2 of 5; even digit count |
CODABAR | Numeric + A-D start/stop |
| Raster-only | Use RASTER prefix |
|---|---|
CODE93, CODE11 | No native ESC/POS in firmware |
| Attribute | Description |
|---|---|
height | Height in dots (default 64) |
align | left, center, right |
show_text | Native only: human-readable text under barcode |
QR code
Native (ESC/POS QR, model 2):
@qr https://example.com/${Id}
@qr ${Url} size=6 ecc=H align=center
Raster (bitmap; QR versions 1–40):
@qr RASTER https://example.com/${Id}
@qr RASTER ${Url} version=5 scale=4 ecc=M
| Attribute | Native | Raster |
|---|---|---|
size | Module dot size 1–16 | — |
scale | — | Pixels per module (default 4) |
version | — | QR version 1–40 (optional) |
ecc | L, M, Q, H | Same |
align | left, center, right | Same |
---
Parameters
${ParameterName} in text, barcode data, QR data, or image paths.
- Same name → one input at print time (GUI or CLI).
- CLI requires every parameter via
--set Name=Value.
---
Example receipt
# ${StoreName}
:center:
Receipt: ${DocumentNumber}
@date
@time
@barcode CODE128 ${DocumentNumber}
@qr RASTER https://shop.example.com/r/${DocumentNumber} scale=4
@feed 4
@cut
---
GUI printing
1. Print → enter parameters → choose a printer → Print.
Printers may appear as:
- USB printer-class devices (direct bulk OUT)
- Windows spooler queues (Windows)
- Serial / USB-serial ports (
COMx,/dev/ttyUSB0, …)
Linux serial: join the dialout group.
---
CLI
posprint print receipt.pos -p COM3 --set StoreName=Shop
posprint cli-help
-p accepts a serial port name, USB device label from discovery, or (on Windows) a spooler queue name. See platform CLI help via posprint cli-help.
---
.pos file format
JSON with version, metadata, and body (template source). See FILE-FORMAT.md.
Source
| 1 | # posprint Help |
| 2 | |
| 3 | Built-in reference for the template editor and POS markup language. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Application tabs |
| 8 | |
| 9 | | Tab | Purpose | |
| 10 | |-----|---------| |
| 11 | | **Design** | Side-by-side template editor and live preview | |
| 12 | | **Help** | This documentation | |
| 13 | |
| 14 | ## Toolbar actions |
| 15 | |
| 16 | | Action | Description | |
| 17 | |--------|-------------| |
| 18 | | **New** | Empty template with defaults | |
| 19 | | **Open** | Load a `.pos` file | |
| 20 | | **Save / Save As** | Write `.pos` file (metadata + body) | |
| 21 | | **Insert** | Images, barcodes, QR, date/time, parameters, `@feed`, `@cut` | |
| 22 | | **Print** | Enter parameters, pick a printer, send ESC/POS bytes | |
| 23 | |
| 24 | While the Print dialog is open, the rest of the UI (including editor autocomplete) is disabled so parameter fields keep focus. |
| 25 | |
| 26 | ## Editor assistance |
| 27 | |
| 28 | - Type `@` at the start of a line for **directive autocomplete** (`feed`, `cut`, `image`, `barcode`, `qr`, `date`, `time`). |
| 29 | - Use **Insert → Barcode / QR code** to pick native or raster type before inserting a snippet. |
| 30 | |
| 31 | ## Page settings |
| 32 | |
| 33 | | Setting | Description | |
| 34 | |---------|-------------| |
| 35 | | **Page width (mm)** | Paper width — match your physical roll (e.g. `53`, `58`, `80`) | |
| 36 | | **Preview zoom** | Screen zoom; `100%` is calibrated to typical receipt width on screen | |
| 37 | |
| 38 | Preview width and text use the same calibrated screen scale. Preview font size is bumped to match printed Font A. Blank lines / `@feed` use the same line spacing as printed text. Heading `#` uses double width/height like GS `!` on the printer; `##` uses bold only. |
| 39 | |
| 40 | If the document does not end with `@cut` (ignoring blank lines after it), a red warning appears next to **Help**. |
| 41 | |
| 42 | --- |
| 43 | |
| 44 | ## Template language |
| 45 | |
| 46 | A template is plain text: paragraphs, headings, lists, checkboxes, directives, and `${parameters}`. There is **no** inline bold/italic/code markup — asterisks and backticks print literally. |
| 47 | |
| 48 | ### Paragraphs |
| 49 | |
| 50 | Consecutive non-empty lines form one paragraph. |
| 51 | |
| 52 | ### Headings |
| 53 | |
| 54 | ```markdown |
| 55 | # Large heading |
| 56 | ## Bold heading |
| 57 | ``` |
| 58 | |
| 59 | ### Alignment |
| 60 | |
| 61 | `:left:`, `:center:`, or `:right:` before a paragraph. |
| 62 | |
| 63 | ### Bullet lists |
| 64 | |
| 65 | ```markdown |
| 66 | - first item |
| 67 | - second item |
| 68 | ``` |
| 69 | |
| 70 | Long items wrap with a hanging indent (printed/previewed as ASCII `*`): |
| 71 | |
| 72 | ```text |
| 73 | * this is a |
| 74 | long line |
| 75 | ``` |
| 76 | |
| 77 | ### Parameters |
| 78 | |
| 79 | | Syntax | Effect | |
| 80 | |--------|--------| |
| 81 | | `${Name}` | Parameter (filled at print time) | |
| 82 | |
| 83 | ### Checkboxes |
| 84 | |
| 85 | Inline checkboxes (ASCII on print/preview): |
| 86 | |
| 87 | | Syntax | Result | |
| 88 | |--------|--------| |
| 89 | | `[]` or `[ ]` | Empty box `[ ]` | |
| 90 | | `[x]` or `[X]` | Checked box `[x]` | |
| 91 | |
| 92 | ```markdown |
| 93 | [] Unchecked |
| 94 | [ ] Also unchecked |
| 95 | [x] Done |
| 96 | ``` |
| 97 | |
| 98 | ### Horizontal rule |
| 99 | |
| 100 | ```markdown |
| 101 | --- |
| 102 | ``` |
| 103 | |
| 104 | ### Comments |
| 105 | |
| 106 | ```markdown |
| 107 | <!-- not printed --> |
| 108 | ``` |
| 109 | |
| 110 | --- |
| 111 | |
| 112 | ## Directives |
| 113 | |
| 114 | Directives start with `@` at the beginning of a line. |
| 115 | |
| 116 | ### Paper feed / cut |
| 117 | |
| 118 | ```markdown |
| 119 | @feed 3 |
| 120 | @cut |
| 121 | ``` |
| 122 | |
| 123 | Blank lines in the editor also feed one line (same as `@feed 1`). |
| 124 | |
| 125 | ### Date / time |
| 126 | |
| 127 | ```markdown |
| 128 | @date |
| 129 | @date DD-MM-YYYY |
| 130 | @time |
| 131 | @time 12h |
| 132 | @time 24h |
| 133 | ``` |
| 134 | |
| 135 | - `@date` with no pattern uses the system regional short date. |
| 136 | - Custom patterns use tokens such as `YYYY`, `MM`, `DD`. |
| 137 | - `@time` defaults to 24-hour; use `12h` or `24h`. |
| 138 | |
| 139 | ### Image |
| 140 | |
| 141 | ```markdown |
| 142 | @image logo.png |
| 143 | @image ${LogoPath} width=50% align=center |
| 144 | ``` |
| 145 | |
| 146 | ### Barcode |
| 147 | |
| 148 | **Native** (printer draws barcode via ESC/POS): |
| 149 | |
| 150 | ```markdown |
| 151 | @barcode CODE128 ${OrderId} |
| 152 | @barcode UPC-A 012345678905 |
| 153 | @barcode ITF 12345678 height=80 |
| 154 | ``` |
| 155 | |
| 156 | **Raster** (bitmap). Raster barcodes stretch horizontally to full paper width; height follows `height`. |
| 157 | |
| 158 | ```markdown |
| 159 | @barcode RASTER CODE128 ${OrderId} |
| 160 | @barcode RASTER CODE93 ABC-1234 |
| 161 | ``` |
| 162 | |
| 163 | | Native symbology | Notes | |
| 164 | |----------------|-------| |
| 165 | | `CODE128` | Alphanumeric | |
| 166 | | `EAN13`, `EAN8` | Numeric | |
| 167 | | `CODE39` | Alphanumeric | |
| 168 | | `UPC-A`, `UPC-E` | Numeric | |
| 169 | | `ITF` | Interleaved 2 of 5; even digit count | |
| 170 | | `CODABAR` | Numeric + A-D start/stop | |
| 171 | |
| 172 | | Raster-only | Use `RASTER` prefix | |
| 173 | |-------------|---------------------| |
| 174 | | `CODE93`, `CODE11` | No native ESC/POS in firmware | |
| 175 | |
| 176 | | Attribute | Description | |
| 177 | |-----------|-------------| |
| 178 | | `height` | Height in dots (default `64`) | |
| 179 | | `align` | `left`, `center`, `right` | |
| 180 | | `show_text` | Native only: human-readable text under barcode | |
| 181 | |
| 182 | ### QR code |
| 183 | |
| 184 | **Native** (ESC/POS QR, model 2): |
| 185 | |
| 186 | ```markdown |
| 187 | @qr https://example.com/${Id} |
| 188 | @qr ${Url} size=6 ecc=H align=center |
| 189 | ``` |
| 190 | |
| 191 | **Raster** (bitmap; QR versions 1–40): |
| 192 | |
| 193 | ```markdown |
| 194 | @qr RASTER https://example.com/${Id} |
| 195 | @qr RASTER ${Url} version=5 scale=4 ecc=M |
| 196 | ``` |
| 197 | |
| 198 | | Attribute | Native | Raster | |
| 199 | |-----------|--------|--------| |
| 200 | | `size` | Module dot size 1–16 | — | |
| 201 | | `scale` | — | Pixels per module (default `4`) | |
| 202 | | `version` | — | QR version 1–40 (optional) | |
| 203 | | `ecc` | `L`, `M`, `Q`, `H` | Same | |
| 204 | | `align` | `left`, `center`, `right` | Same | |
| 205 | |
| 206 | --- |
| 207 | |
| 208 | ## Parameters |
| 209 | |
| 210 | `${ParameterName}` in text, barcode data, QR data, or image paths. |
| 211 | |
| 212 | - Same name → **one input** at print time (GUI or CLI). |
| 213 | - CLI requires **every** parameter via `--set Name=Value`. |
| 214 | |
| 215 | --- |
| 216 | |
| 217 | ## Example receipt |
| 218 | |
| 219 | ```markdown |
| 220 | # ${StoreName} |
| 221 | :center: |
| 222 | |
| 223 | Receipt: ${DocumentNumber} |
| 224 | @date |
| 225 | @time |
| 226 | |
| 227 | @barcode CODE128 ${DocumentNumber} |
| 228 | @qr RASTER https://shop.example.com/r/${DocumentNumber} scale=4 |
| 229 | |
| 230 | @feed 4 |
| 231 | @cut |
| 232 | ``` |
| 233 | |
| 234 | --- |
| 235 | |
| 236 | ## GUI printing |
| 237 | |
| 238 | 1. **Print** → enter parameters → choose a printer → **Print**. |
| 239 | |
| 240 | Printers may appear as: |
| 241 | |
| 242 | - **USB printer-class** devices (direct bulk OUT) |
| 243 | - **Windows spooler** queues (Windows) |
| 244 | - **Serial / USB-serial** ports (`COMx`, `/dev/ttyUSB0`, …) |
| 245 | |
| 246 | **Linux serial:** join the `dialout` group. |
| 247 | |
| 248 | --- |
| 249 | |
| 250 | ## CLI |
| 251 | |
| 252 | ```bash |
| 253 | posprint print receipt.pos -p COM3 --set StoreName=Shop |
| 254 | posprint cli-help |
| 255 | ``` |
| 256 | |
| 257 | `-p` accepts a serial port name, USB device label from discovery, or (on Windows) a spooler queue name. See platform CLI help via `posprint cli-help`. |
| 258 | |
| 259 | --- |
| 260 | |
| 261 | ## `.pos` file format |
| 262 | |
| 263 | JSON with `version`, `metadata`, and `body` (template source). See [FILE-FORMAT.md](FILE-FORMAT.md). |