BlueGit

timfa posprint

Files

posprint / docs / HELP.md

HELP.md

HELP.md 4.3 KiB Download Raw

posprint Help

Built-in reference for the template editor and POS markup language.

---

Application tabs

TabPurpose
EditorWrite and edit template source
PreviewLive preview of rendered output
HelpThis documentation

Toolbar actions

ActionDescription
NewEmpty template with defaults
OpenLoad a .pos file
Save / Save AsWrite .pos file (metadata + body)
InsertMenu to insert images, barcodes, QR codes, @feed, @cut
PrintSubstitute parameters, pick USB printer, send ESC/POS bytes

Editor assistance

  • Type @ at the start of a line to see directive autocomplete (feed, cut, image, barcode, qr).
  • Use Insert → Barcode / QR code to pick native or raster type before inserting a snippet.

Page settings

SettingDescription
Page width (mm)Paper width, typically 58 or 80

---

Template language

A template is plain text: paragraphs, headings, directives, and inline markup.

Paragraphs

Consecutive non-empty lines form one paragraph.

Headings

# Large heading
## Bold heading

Alignment

:left:, :center:, or :right: before a paragraph.

Inline markup

SyntaxEffect
**text**Bold
*text*Italic
text Monospace
${Name}Parameter (filled at print time)

Horizontal rule

---

Comments

<!-- not printed -->

---

Directives

Directives start with @ at the beginning of a line.

Paper feed / cut

@feed 3
@cut

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 (rendered as bitmap — works with any symbology below). Raster barcodes are stretched horizontally to the full paper width for reliable scanning; height follows the height attribute.

@barcode RASTER CODE128 ${OrderId}
@barcode RASTER CODE93 ABC-1234
Native symbologyNotes
CODE128Alphanumeric
EAN13, EAN8Numeric
CODE39Alphanumeric
UPC-A, UPC-ENumeric
ITFInterleaved 2 of 5; even digit count
CODABARNumeric + A-D start/stop
Raster-only symbologyUse RASTER prefix
CODE93, CODE11No native ESC/POS in firmware
AttributeDescription
heightHeight in dots (default 64; raster PNG height)
alignleft, center, right
show_textNative 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; supports QR versions 1–40):

@qr RASTER https://example.com/${Id}
@qr RASTER ${Url} version=5 scale=4 ecc=M
AttributeNativeRaster
sizeModule dot size 1–16—
scale—Pixels per module (default 4)
version—QR version 1–40 (optional; auto if omitted)
eccL, M, Q, HSame
alignleft, center, rightSame

---

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}

@barcode CODE128 ${DocumentNumber}
@qr RASTER https://shop.example.com/r/${DocumentNumber} scale=4

@feed 4
@cut

---

GUI printing (USB)

1. Print → enter parameters → choose serial port → Print.

Linux: dialout group. Windows: printer appears as COMx.

---

.pos file format

JSON with version, metadata, and body (template source).

Source
1# posprint Help
2
3Built-in reference for the template editor and POS markup language.
4
5---
6
7## Application tabs
8
9| Tab | Purpose |
10|-----|---------|
11| **Editor** | Write and edit template source |
12| **Preview** | Live preview of rendered output |
13| **Help** | This documentation |
14
15## Toolbar actions
16
17| Action | Description |
18|--------|-------------|
19| **New** | Empty template with defaults |
20| **Open** | Load a `.pos` file |
21| **Save / Save As** | Write `.pos` file (metadata + body) |
22| **Insert** | Menu to insert images, barcodes, QR codes, `@feed`, `@cut` |
23| **Print** | Substitute parameters, pick USB printer, send ESC/POS bytes |
24
25## Editor assistance
26
27- Type `@` at the start of a line to see **directive autocomplete** (`feed`, `cut`, `image`, `barcode`, `qr`).
28- Use **Insert → Barcode / QR code** to pick native or raster type before inserting a snippet.
29
30## Page settings
31
32| Setting | Description |
33|---------|-------------|
34| **Page width (mm)** | Paper width, typically `58` or `80` |
35
36---
37
38## Template language
39
40A template is plain text: paragraphs, headings, directives, and inline markup.
41
42### Paragraphs
43
44Consecutive non-empty lines form one paragraph.
45
46### Headings
47
48```markdown
49# Large heading
50## Bold heading
51```
52
53### Alignment
54
55`:left:`, `:center:`, or `:right:` before a paragraph.
56
57### Inline markup
58
59| Syntax | Effect |
60|--------|--------|
61| `**text**` | Bold |
62| `*text*` | Italic |
63| `` `text` `` | Monospace |
64| `${Name}` | Parameter (filled at print time) |
65
66### Horizontal rule
67
68```markdown
69---
70```
71
72### Comments
73
74```markdown
75<!-- not printed -->
76```
77
78---
79
80## Directives
81
82Directives start with `@` at the beginning of a line.
83
84### Paper feed / cut
85
86```markdown
87@feed 3
88@cut
89```
90
91### Image
92
93```markdown
94@image logo.png
95@image ${LogoPath} width=50% align=center
96```
97
98### Barcode
99
100**Native** (printer draws barcode via ESC/POS):
101
102```markdown
103@barcode CODE128 ${OrderId}
104@barcode UPC-A 012345678905
105@barcode ITF 12345678 height=80
106```
107
108**Raster** (rendered as bitmap — works with any symbology below). Raster barcodes are stretched horizontally to the full paper width for reliable scanning; height follows the `height` attribute.
109
110```markdown
111@barcode RASTER CODE128 ${OrderId}
112@barcode RASTER CODE93 ABC-1234
113```
114
115| Native symbology | Notes |
116|----------------|-------|
117| `CODE128` | Alphanumeric |
118| `EAN13`, `EAN8` | Numeric |
119| `CODE39` | Alphanumeric |
120| `UPC-A`, `UPC-E` | Numeric |
121| `ITF` | Interleaved 2 of 5; even digit count |
122| `CODABAR` | Numeric + A-D start/stop |
123
124| Raster-only symbology | Use `RASTER` prefix |
125|-----------------------|---------------------|
126| `CODE93`, `CODE11` | No native ESC/POS in firmware |
127
128| Attribute | Description |
129|-----------|-------------|
130| `height` | Height in dots (default `64`; raster PNG height) |
131| `align` | `left`, `center`, `right` |
132| `show_text` | Native only: human-readable text under barcode |
133
134### QR code
135
136**Native** (ESC/POS QR, model 2):
137
138```markdown
139@qr https://example.com/${Id}
140@qr ${Url} size=6 ecc=H align=center
141```
142
143**Raster** (bitmap; supports QR versions 1–40):
144
145```markdown
146@qr RASTER https://example.com/${Id}
147@qr RASTER ${Url} version=5 scale=4 ecc=M
148```
149
150| Attribute | Native | Raster |
151|-----------|--------|--------|
152| `size` | Module dot size 1–16 | — |
153| `scale` | — | Pixels per module (default `4`) |
154| `version` | — | QR version 1–40 (optional; auto if omitted) |
155| `ecc` | `L`, `M`, `Q`, `H` | Same |
156| `align` | `left`, `center`, `right` | Same |
157
158---
159
160## Parameters
161
162`${ParameterName}` in text, barcode data, QR data, or image paths.
163
164- Same name → **one input** at print time (GUI or CLI).
165- CLI requires **every** parameter via `--set Name=Value`.
166
167---
168
169## Example receipt
170
171```markdown
172# ${StoreName}
173:center:
174
175Receipt: ${DocumentNumber}
176
177@barcode CODE128 ${DocumentNumber}
178@qr RASTER https://shop.example.com/r/${DocumentNumber} scale=4
179
180@feed 4
181@cut
182```
183
184---
185
186## GUI printing (USB)
187
1881. **Print** → enter parameters → choose serial port → **Print**.
189
190**Linux:** `dialout` group. **Windows:** printer appears as `COMx`.
191
192---
193
194## `.pos` file format
195
196JSON with `version`, `metadata`, and `body` (template source).