BlueGit

timfa posprint

Files

posprint / docs / HELP-CLI-LINUX.md

HELP-CLI-LINUX.md

HELP-CLI-LINUX.md 1.5 KiB Download Raw

Command-line printing (Linux)

Print a .pos template without opening the GUI.

Syntax

posprint print <file.pos> --printer <DEVICE> --set Name=Value [--set Other=Value ...]

Short form:

posprint print receipt.pos -p /dev/ttyUSB0 --set StoreName="My Shop" --set DocumentNumber=1001

Rules

  • --printer / -p (required): serial device path, e.g. /dev/ttyUSB0, /dev/ttyACM0.
  • --set NAME=VALUE (required for every parameter): one flag per ${Name} in the template.
  • If any ${Name} is missing or empty, the command fails and lists missing parameters.
  • The GUI is not started when using the print subcommand.

Permissions

Your user must be in the dialout group:

sudo usermod -aG dialout "$USER"
# log out and back in
groups

Examples

posprint print ~/receipts/sale.pos -p /dev/ttyUSB0 \
  --set StoreName="Corner Cafe" \
  --set DocumentNumber=42 \
  --set Date=2026-07-15 \
  --set GrandTotal=19.99

Printer device

ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null

Use the device node shown when the printer is connected.

Exit codes

CodeMeaning
0Printed successfully
1Error (missing parameters, parse error, permission denied, etc.)

Help

posprint print --help
posprint --help

Launch the graphical designer by running posprint with no subcommand.

Source
1# Command-line printing (Linux)
2
3Print a `.pos` template without opening the GUI.
4
5## Syntax
6
7```bash
8posprint print <file.pos> --printer <DEVICE> --set Name=Value [--set Other=Value ...]
9```
10
11Short form:
12
13```bash
14posprint print receipt.pos -p /dev/ttyUSB0 --set StoreName="My Shop" --set DocumentNumber=1001
15```
16
17## Rules
18
19- **`--printer` / `-p`** (required): serial device path, e.g. `/dev/ttyUSB0`, `/dev/ttyACM0`.
20- **`--set NAME=VALUE`** (required for every parameter): one flag per `${Name}` in the template.
21- If any `${Name}` is missing or empty, the command **fails** and lists missing parameters.
22- The GUI is not started when using the `print` subcommand.
23
24## Permissions
25
26Your user must be in the **`dialout`** group:
27
28```bash
29sudo usermod -aG dialout "$USER"
30# log out and back in
31groups
32```
33
34## Examples
35
36```bash
37posprint print ~/receipts/sale.pos -p /dev/ttyUSB0 \
38 --set StoreName="Corner Cafe" \
39 --set DocumentNumber=42 \
40 --set Date=2026-07-15 \
41 --set GrandTotal=19.99
42```
43
44## Printer device
45
46```bash
47ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null
48```
49
50Use the device node shown when the printer is connected.
51
52## Exit codes
53
54| Code | Meaning |
55|------|---------|
56| `0` | Printed successfully |
57| `1` | Error (missing parameters, parse error, permission denied, etc.) |
58
59## Help
60
61```bash
62posprint print --help
63posprint --help
64```
65
66Launch the graphical designer by running `posprint` with **no** subcommand.