BlueGit

timfa posprint

Files

posprint / docs / HELP-CLI-WINDOWS.md

HELP-CLI-WINDOWS.md

HELP-CLI-WINDOWS.md 1.6 KiB Download Raw

Command-line printing (Windows)

Print a .pos template without opening the GUI.

Run posprint cli-help to print this section from the binary (no GUI required).

Syntax

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

Short form:

posprint print receipt.pos -p COM3 --set StoreName="My Shop" --set DocumentNumber=1001

Rules

  • --printer / -p (required): USB-serial port name, e.g. COM3, COM4.
  • --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.

Examples

List required parameters by opening the template in the designer, or inspect the ${...} tokens in the file body.

posprint print C:\receipts\sale.pos -p COM3 `
  --set StoreName="Corner Cafe" `
  --set DocumentNumber=42 `
  --set Date=2026-07-15 `
  --set GrandTotal=19.99

Printer port

  • Open Device Manager → Ports (COM & LPT) to find the printer COM port.
  • Install the USB-serial driver if the device is not listed.
  • Close other programs using the same COM port before printing.

Exit codes

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

Help

posprint print --help
posprint --help

Launch the graphical designer by running posprint with no subcommand.

Source
1# Command-line printing (Windows)
2
3Print a `.pos` template without opening the GUI.
4
5Run `posprint cli-help` to print this section from the binary (no GUI required).
6
7## Syntax
8
9```powershell
10posprint print <file.pos> --printer <PORT> --set Name=Value [--set Other=Value ...]
11```
12
13Short form:
14
15```powershell
16posprint print receipt.pos -p COM3 --set StoreName="My Shop" --set DocumentNumber=1001
17```
18
19## Rules
20
21- **`--printer` / `-p`** (required): USB-serial port name, e.g. `COM3`, `COM4`.
22- **`--set NAME=VALUE`** (required for every parameter): one flag per `${Name}` in the template.
23- If any `${Name}` is missing or empty, the command **fails** and lists missing parameters.
24- The GUI is not started when using the `print` subcommand.
25
26## Examples
27
28List required parameters by opening the template in the designer, or inspect the `${...}` tokens in the file body.
29
30```powershell
31posprint print C:\receipts\sale.pos -p COM3 `
32 --set StoreName="Corner Cafe" `
33 --set DocumentNumber=42 `
34 --set Date=2026-07-15 `
35 --set GrandTotal=19.99
36```
37
38## Printer port
39
40- Open **Device Manager → Ports (COM & LPT)** to find the printer COM port.
41- Install the USB-serial driver if the device is not listed.
42- Close other programs using the same COM port before printing.
43
44## Exit codes
45
46| Code | Meaning |
47|------|---------|
48| `0` | Printed successfully |
49| `1` | Error (missing parameters, parse error, port error, etc.) |
50
51## Help
52
53```powershell
54posprint print --help
55posprint --help
56```
57
58Launch the graphical designer by running `posprint` with **no** subcommand.