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