BlueGit

timfa posprint

Files

posprint / docs / HELP-CLI-WINDOWS.md

HELP-CLI-WINDOWS.md

feat: include paired Classic Bluetooth SPP printers in discovery
timfa project_84475926_bot_3b4fb417c41b9b24a7422b6452f025d2 · pushed by timfa · 8 weeks ago
8b514b7f History
HELP-CLI-WINDOWS.md 2.4 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 list
posprint print <file.pos> --printer <PORT> --set Name=Value [--set Other=Value ...]
posprint link <file.pos>

Short form:

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

Rules

  • posprint list: print discovered printers (USB, spooler, USB-serial, paired Classic Bluetooth SPP).
  • --printer / -p (required): serial port (COM3, including a Bluetooth SPP COM after OS pairing), or a Windows printer queue name for spooler printing.
  • --set NAME=VALUE (required for every parameter): one flag per ${Name} or $[Name] in the template.
  • Checkbox params ($[Name]): use true/false (also 1/0, yes/no).
  • If any text ${Name} is missing or empty, or a $[Name] is omitted / not a boolean, the command fails.
  • The GUI is not started when using the print subcommand.
  • posprint link encodes the .pos file as a posprint:// URL on stdout (see POSPRINT-URL.md). Warns if the URL is very long.

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 target

  • Serial: Device Manager → Ports (COM & LPT) for the COM port; install the USB-serial driver if needed.
  • Bluetooth SPP: pair the printer in Windows first, then use the virtual COM port (posprint list labels it Bluetooth). BLE is not supported.
  • Spooler: use the Windows printer queue name as -p (same name as in Settings → Printers).
  • 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 link --help
posprint --help

Launch the graphical designer by running posprint with no subcommand. Opening a posprint://… URL (from a browser) or posprint --print starts print-only mode: live preview on the left, parameters and printer on the right.

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 list
11posprint print <file.pos> --printer <PORT> --set Name=Value [--set Other=Value ...]
12posprint link <file.pos>
13```
14
15Short form:
16
17```powershell
18posprint list
19posprint print receipt.pos -p COM3 --set StoreName="My Shop" --set DocumentNumber=1001
20posprint link receipt.pos
21```
22
23## Rules
24
25- **`posprint list`**: print discovered printers (USB, spooler, USB-serial, paired Classic Bluetooth SPP).
26- **`--printer` / `-p`** (required): serial port (`COM3`, including a Bluetooth SPP COM after OS pairing), or a Windows printer queue name for spooler printing.
27- **`--set NAME=VALUE`** (required for every parameter): one flag per `${Name}` or `$[Name]` in the template.
28- Checkbox params (`$[Name]`): use `true`/`false` (also `1`/`0`, `yes`/`no`).
29- If any text `${Name}` is missing or empty, or a `$[Name]` is omitted / not a boolean, the command **fails**.
30- The GUI is not started when using the `print` subcommand.
31- **`posprint link`** encodes the `.pos` file as a `posprint://` URL on stdout (see [POSPRINT-URL.md](POSPRINT-URL.md)). Warns if the URL is very long.
32
33## Examples
34
35List required parameters by opening the template in the designer, or inspect the `${...}` tokens in the file body.
36
37```powershell
38posprint print C:\receipts\sale.pos -p COM3 `
39 --set StoreName="Corner Cafe" `
40 --set DocumentNumber=42 `
41 --set Date=2026-07-15 `
42 --set GrandTotal=19.99
43```
44
45## Printer target
46
47- Serial: **Device Manager → Ports (COM & LPT)** for the COM port; install the USB-serial driver if needed.
48- Bluetooth SPP: pair the printer in Windows first, then use the virtual COM port (`posprint list` labels it Bluetooth). BLE is not supported.
49- Spooler: use the Windows printer queue name as `-p` (same name as in Settings → Printers).
50- Close other programs using the same COM port before printing.
51
52## Exit codes
53
54| Code | Meaning |
55|------|---------|
56| `0` | Printed successfully |
57| `1` | Error (missing parameters, parse error, port error, etc.) |
58
59## Help
60
61```powershell
62posprint print --help
63posprint link --help
64posprint --help
65```
66
67Launch the graphical designer by running `posprint` with **no** subcommand. Opening a `posprint://…` URL (from a browser) or `posprint --print` starts print-only mode: live preview on the left, parameters and printer on the right.