https://github.com/mimoja/ptouch-web
Webinterface to print tables on PTouchCube PT-P770 and others
https://github.com/mimoja/ptouch-web
Last synced: about 1 year ago
JSON representation
Webinterface to print tables on PTouchCube PT-P770 and others
- Host: GitHub
- URL: https://github.com/mimoja/ptouch-web
- Owner: Mimoja
- License: gpl-3.0
- Created: 2023-02-27T17:48:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T13:04:06.000Z (almost 2 years ago)
- Last Synced: 2024-06-26T14:09:05.229Z (almost 2 years ago)
- Language: Go
- Size: 1.42 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PTouch-Web
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:
```bash
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:
```docker-compose
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
```