Mimoja / PTouch-Web

Webinterface to print tables on PTouchCube PT-P770 and others

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PTouch-Web

A web interface to your PTouch printer

Screenshot Multiline

  • PTouch-Web uses the system fonts to render the shown image.
  • The webinterface works without Javascript, however the font selection uses JavaScript to change the font= parameter in the URL.
  • It provides a /print GET endpoint for cli usage:
    curl http://labelprinter.local/print?fontsize=48&font=Ubuntu-L.ttf&label=Hello%20World
  • The Font field is fuzzy searchable by font name and font family

Connecting via USB

go build .
./ptouch-web usb

Ensure your user has the proper permissions to access /dev/bus/usb or change the permissions there

Recommended fonts (debian):

  • ttf-ubuntu-font-family
  • ttf-mscorefonts-installer
  • fonts-croscore
  • fonts-liberation2
  • fonts-freefont-ttf
sudo apt install ttf-ubuntu-font-family ttf-mscorefonts-installer fonts-freefont-ttf fonts-liberation2 fonts-croscore

Deployment

You can create a overwrite docker-compose.prod.yml to map custom fonts or device:

version: "3.3"
services:
  ptouch-web:
    volumes:
      - /usr/share/fonts/:/usr/local/share/fonts/:ro
    ports:
      - 80:8080

and run with docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build

Connecting an rfcomm node via bluetooth

After connecting to the device it will automatically disconnect again. On linux you can list the device by using bluetooth-ctl's paired-devices listing. e.g.

[bluetooth]# paired-devices
Device EC:79:49:65:XX:XX PT-P300BTXXXX

You can then create an rfcom device from the bl address:

sudo rfcomm bind 0 EC:79:49:65:XX:XX 1

Afterwards PTouch-Web can be passed the rfcomm device

ptouch-web /dev/rfcomm0

About

Webinterface to print tables on PTouchCube PT-P770 and others

License:GNU General Public License v3.0


Languages

Language:Go 66.0%Language:HTML 31.8%Language:Dockerfile 1.5%Language:CSS 0.7%