ptouch

Crates.ioptouch
lib.rsptouch
version0.2.2
sourcesrc
created_at2021-03-21 07:01:26.729812
updated_at2023-01-14 21:31:57.44448
descriptionBrother PTouch label maker driver and utility
homepage
repositoryhttps://github.com/ryankurte/rust-ptouch
max_upload_size
id371604
size110,636
ryan (ryankurte)

documentation

README

Brother P-Touch Raster Driver (and utility)

Brother P-Touch Label-Maker Raster Driver for PT-E550W/P750W/P710BT devices.

Status

Extremely alpha, tested only on the PT-P710BT, API subject to change

GitHub tag Build Status Crates.io Docs.rs

Usage

Utility

Install with cargo install ptouch or grab the latest release here.

The utility supports a set of basic subcommands:

  • ptouch-util [SUBCOMMAND] --help to show help options
  • ptouch-util [--media MEDIA] render --file=[OUTPUT] [OPTIONS] to render to an OUTPUT image file
  • ptouch-util [--media MEDIA] preview [OPTIONS] to render to a preview window (not available on all platforms)
  • ptouch-util print [OPTIONS] to print

The --media argument sets the default media type when the printer is unavailable, otherwise this is loaded from the printer.

Each of render, preview, and print take a set of [OPTIONS] to configure the output, these options are:

  • text VALUE [--font=FONT] to render text in the specified font, use \n for newlines
  • qr CODE to render a QRCode with the provided value
  • qr-text CODE VALUE [--font=FONT] to render a QRCode followed by text
  • image FILE to render an image directly
  • template FILE to load a .toml render template (see example.toml)
  • barcode CODE to render a barcode (experimental, missing config options)

These CLI options are a subset of those available using the library intended to provide the basics. If you think there's something missing, feel free to open an issue / PR!

API

This needs cleaning up before it's reasonable to use... for usage see src/util.rs.

Examples

ptouch-util --media tze24mm preview qr-text \
'https://github.com/ryankurte/rust-ptouch' \
'Rust PTouch Driver\n@ryankurte' --font=24x32`

image

ptouch-util print qr-text \
"https://github.com/ryankurte/rust-ptouch" \
"Rust PTouch Driver\n@ryankurte" --font=24x32

IMG_1840

Resources

Commit count: 53

cargo fmt