BlueGit

timfa posprint

Files

posprint / docs / HELP-CLI-WINDOWS.md

HELP-CLI-WINDOWS.md

HELP-CLI-WINDOWS.md 2.1 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 ...]
posprint link <file.pos>

Short form:

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

Rules

  • --printer / -p (required): serial port (COM3), a Windows printer queue name for spooler printing, or LAN host / host:9100.
  • --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.
  • 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 print <file.pos> --printer <PORT> --set Name=Value [--set Other=Value ...]
11posprint link <file.pos>
12```
13
14Short form:
15
16```powershell
17posprint print receipt.pos -p COM3 --set StoreName="My Shop" --set DocumentNumber=1001
18posprint link receipt.pos
19```
20
21## Rules
22
23- **`--printer` / `-p`** (required): serial port (`COM3`), a Windows printer queue name for spooler printing, or LAN `host` / `host:9100`.
24- **`--set NAME=VALUE`** (required for every parameter): one flag per `${Name}` or `$[Name]` in the template.
25- Checkbox params (`$[Name]`): use `true`/`false` (also `1`/`0`, `yes`/`no`).
26- If any text `${Name}` is missing or empty, or a `$[Name]` is omitted / not a boolean, the command **fails**.
27- The GUI is not started when using the `print` subcommand.
28- **`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.
29
30## Examples
31
32List required parameters by opening the template in the designer, or inspect the `${...}` tokens in the file body.
33
34```powershell
35posprint print C:\receipts\sale.pos -p COM3 `
36 --set StoreName="Corner Cafe" `
37 --set DocumentNumber=42 `
38 --set Date=2026-07-15 `
39 --set GrandTotal=19.99
40```
41
42## Printer target
43
44- Serial: **Device Manager → Ports (COM & LPT)** for the COM port; install the USB-serial driver if needed.
45- Spooler: use the Windows printer queue name as `-p` (same name as in Settings → Printers).
46- Close other programs using the same COM port before printing.
47
48## Exit codes
49
50| Code | Meaning |
51|------|---------|
52| `0` | Printed successfully |
53| `1` | Error (missing parameters, parse error, port error, etc.) |
54
55## Help
56
57```powershell
58posprint print --help
59posprint link --help
60posprint --help
61```
62
63Launch 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.