Print markdown files to a thermal receipt printer. Write a .md file with standard markdown and ticketmax renders it on any ESC/POS printer over TCP, USB, or serial.
Set PRINTER_ADDR to your printer's address:
bash
# TCP:
export PRINTER_ADDR=192.168.1.100:9100
# USB:
export PRINTER_ADDR=/dev/usb/lp0
# Serial:
export PRINTER_ADDR=/dev/ttyUSB0
bash
# Print a markdown file
ticketmax report.md
# Pipe from stdin
echo "# Hello World" | ticketmax -
# Check printer connectivity
ticketmax -status
# Print a test receipt
ticketmax -test
FlagDefaultDescription-addr``127.0.0.1:9100Printer host:port or device path (env: PRINTER_ADDR)-baud``9600Baud rate for serial connections-timeout``5sNetwork connection timeout-width``46Paper width in characters (1–120)-spacing``20Line spacing in printer units (0–255)-testPrint test receipt and exit-statusCheck connectivity and exit
MarkdownPrinter Output# HeadingBold, double-size, centered## HeadingBold, double-width, centered### HeadingBold**bold text**Bold line<u>text</u>Underlined line---Separator line| A | B |Two columns (right-aligned values)| A | B | C |Three columnsPrint image (PNG, JPEG, GIF) ```qrQR code block<!-- cut -->Cut paper<!-- beep -->Buzzer (1 beep)<!-- beep N -->Buzzer (N beeps)
To print a report, write markdown to a temp file and pipe it to ticketmax:
bash
cat <<'EOF' > /tmp/report.md
# Morning Report
## Sales
| Item | Revenue |
| --- | --- |
| Widget A | $1,234 |
| Gadget B | $567 |
---
**Low stock: Widget A (3 units)**
```qr
https://dashboard.example.com
EOF
ticketmax /tmp/report.md
text
Or pipe directly from stdin:
```bash
echo "# Alert\n\n**Server down at $(date)**\n\n<!-- beep 3 -->" | ticketmax -