BlueGit

timfa posprint

Files

posprint / docs / HELP.md

HELP.md

HELP.md 4.4 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 — set this to match your physical roll (e.g. 53, 58, 80)
Preview zoomScreen zoom only; layout uses printer dots at 100%

Preview width matches printable dots (203 DPI). Blank lines in the editor feed paper the same as @feed 1.

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, 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 — set this to match your physical roll (e.g. `53`, `58`, `80`) |
35| **Preview zoom** | Screen zoom only; layout uses printer dots at 100% |
36
37Preview width matches printable dots (203 DPI). Blank lines in the editor feed paper the same as `@feed 1`.
38
39If the document does not end with `@cut` (ignoring blank lines after it), a red warning appears next to **Help**.
40
41---
42
43## Template language
44
45A template is plain text: paragraphs, headings, directives, and inline markup.
46
47### Paragraphs
48
49Consecutive non-empty lines form one paragraph.
50
51### Headings
52
53```markdown
54# Large heading
55## Bold heading
56```
57
58### Alignment
59
60`:left:`, `:center:`, or `:right:` before a paragraph.
61
62### Inline markup
63
64| Syntax | Effect |
65|--------|--------|
66| `**text**` | Bold |
67| `*text*` | Italic |
68| `` `text` `` | Monospace |
69| `${Name}` | Parameter (filled at print time) |
70
71### Horizontal rule
72
73```markdown
74---
75```
76
77### Comments
78
79```markdown
80<!-- not printed -->
81```
82
83---
84
85## Directives
86
87Directives start with `@` at the beginning of a line.
88
89### Paper feed / cut
90
91```markdown
92@feed 3
93@cut
94```
95
96### Image
97
98```markdown
99@image logo.png
100@image ${LogoPath} width=50% align=center
101```
102
103### Barcode
104
105**Native** (printer draws barcode via ESC/POS):
106
107```markdown
108@barcode CODE128 ${OrderId}
109@barcode UPC-A 012345678905
110@barcode ITF 12345678 height=80
111```
112
113**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.
114
115```markdown
116@barcode RASTER CODE128 ${OrderId}
117@barcode RASTER CODE93 ABC-1234
118```
119
120| Native symbology | Notes |
121|----------------|-------|
122| `CODE128` | Alphanumeric |
123| `EAN13`, `EAN8` | Numeric |
124| `CODE39` | Alphanumeric |
125| `UPC-A`, `UPC-E` | Numeric |
126| `ITF` | Interleaved 2 of 5; even digit count |
127| `CODABAR` | Numeric + A-D start/stop |
128
129| Raster-only symbology | Use `RASTER` prefix |
130|-----------------------|---------------------|
131| `CODE93`, `CODE11` | No native ESC/POS in firmware |
132
133| Attribute | Description |
134|-----------|-------------|
135| `height` | Height in dots (default `64`; raster PNG height) |
136| `align` | `left`, `center`, `right` |
137| `show_text` | Native only: human-readable text under barcode |
138
139### QR code
140
141**Native** (ESC/POS QR, model 2):
142
143```markdown
144@qr https://example.com/${Id}
145@qr ${Url} size=6 ecc=H align=center
146```
147
148**Raster** (bitmap; supports QR versions 1–40):
149
150```markdown
151@qr RASTER https://example.com/${Id}
152@qr RASTER ${Url} version=5 scale=4 ecc=M
153```
154
155| Attribute | Native | Raster |
156|-----------|--------|--------|
157| `size` | Module dot size 1–16 | — |
158| `scale` | — | Pixels per module (default `4`) |
159| `version` | — | QR version 1–40 (optional; auto if omitted) |
160| `ecc` | `L`, `M`, `Q`, `H` | Same |
161| `align` | `left`, `center`, `right` | Same |
162
163---
164
165## Parameters
166
167`${ParameterName}` in text, barcode data, QR data, or image paths.
168
169- Same name → **one input** at print time (GUI or CLI).
170- CLI requires **every** parameter via `--set Name=Value`.
171
172---
173
174## Example receipt
175
176```markdown
177# ${StoreName}
178:center:
179
180Receipt: ${DocumentNumber}
181
182@barcode CODE128 ${DocumentNumber}
183@qr RASTER https://shop.example.com/r/${DocumentNumber} scale=4
184
185@feed 4
186@cut
187```
188
189---
190
191## GUI printing (USB)
192
1931. **Print** → enter parameters → choose serial port → **Print**.
194
195**Linux:** `dialout` group. **Windows:** printer appears as `COMx`.
196
197---
198
199## `.pos` file format
200
201JSON with `version`, `metadata`, and `body` (template source).