A web interface to your PTouch printer
- 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
go build .
./ptouch-web usb
Ensure your user has the proper permissions to access /dev/bus/usb or change the permissions there
- 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
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
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