# P-Touch Web for Brother PT-P700 **English** | [Deutsch](README.de.md) A small Flask web app to design labels and print them on a Brother P-touch PT-P700 connected by USB to a Docker host (e.g. Unraid). It recreates the most important P-touch Editor functions in the browser. ## Features - Tape width, automatic length, margin and orientation; tape detection (width, printable pixels, tape type, colours) - Freely positioned objects: text, symbols, frames/shapes, lines, tables - Image import with black/white conversion, QR code and Code128 barcode - Save/load layouts in the browser, server-side preview - Cut modes: normal, chain print/strip, cut mark, strip with cut mark - Print queue that waits until the printer is reachable - Simple text-only mobile view at `/mobile` ## Requirements - Brother PT-P700 in **normal printer mode** (Editor Lite LED off; it must not show up as `RemovableDisk` in `lsusb`) - Docker with USB access to the printer: `/dev/bus/usb` mounted and a privileged container - Printing uses [`ptouch-print`](https://github.com/farixembedded/ptouch-print), which is built into the image ## Installation ```sh git clone P-Touch-Web cd P-Touch-Web docker compose up --build ``` Then open (mobile view: ). For Unraid there is `unraid-template.xml`; a variant without a custom image (mounting the project into `python:3.12-alpine`) is described in [docs/DETAILS.md](docs/DETAILS.md) (German). ## Configuration | Variable | Default | Meaning | |---|---|---| | `PRINT_ENABLED` | `1` | `0` only renders a PNG, `1` prints | | `PRINT_COMMAND` | `ptouch-print --image {image}` | print command; `{image}` is replaced, `{cut_args}` optional | | `LABEL_DPI` | `180` | matches the PT-P700 | | `LABEL_DIR` | `./labels` | rendered PNGs and the print queue (`queue/`); mount persistently | | `PRINT_QUEUE_ENABLED` | `1` | queue jobs and print once the printer is reachable | | `PRINT_QUEUE_RETRY_SECONDS` | `30` | retry interval for queued jobs | | `SECRET_KEY` | `change-me` | Flask session key, **set your own value** | ## Usage Design the label in the browser, check the preview and print. The PT-P700 supports full cuts and chain printing but no half cut; "chain print / strip" renders several copies as one long image without full cuts in between. Test the USB connection inside the container with `ptouch-print --info`. Troubleshooting for `PLite Mode`, `LIBUSB_ERROR_IO` and the `usblp` kernel module: [docs/DETAILS.md](docs/DETAILS.md). ## Security The app has no login. Run it only in a trusted network or behind a reverse proxy with authentication, and set `SECRET_KEY`. The container is privileged because it needs raw USB access. ## License MIT, see [LICENSE](LICENSE).