@gauntface/printboy
v0.0.13
Published
A simple service to print labels.
Downloads
2
Readme
Printboy
A simple service to print labels.
This is built for personal use case of easily printing return labels from a Raspberry Pi but there is no reason it couldn't be altered and improved for your use-cases.
It works by "generating" a label on a HTML canvas which is saved
as a png and then printed via an lp
command.
Setup
Print install
The first thing to do is ensure the printer works via CUPs.
A lot of this is from these articles:
- https://www.baitando.com/it/2017/12/12/install-dymo-labelwriter-on-headless-linux
- https://www.taklischris.info/other/use-your-dymo-printer-on-ubuntu
Install CUPs
sudo apt-get install -y git cups cups-client printer-driver-dymo
orsudo dnf install cups-deve;
Get printer definition
git clone https://github.com/matthiasbock/dymo-cups-drivers.git
sudo mkdir -p /usr/share/cups/model
sudo cp dymo-cups-drivers/ppd/lw450.ppd /usr/share/cups/model/
Add yourself as a cups admin
sudo usermod -a -G lpadmin $USER
Allow remote access to cups:
sudo cupsctl --remote-admin sudo service cups restart
Go to CUPs admin page http://localhost:631
- Use your computer login credentials for the username and password for the site
Install the printer
- IMPORTANT: Use
DYMO_LabelWriter_450_Turbo
for the printer name, otherwiseprintboy
will not work. - Cups should pick the correct driver for you.
- For general:
- Output Resolution: 300x600 DPI
- Print Quality: Barcodes and Graphics
- Media Size:
- 30252 Address:
1-1/8" x 3"
- 30364 Name Badge:
2-1/4" x 4"
- 30252 Address:
- IMPORTANT: Use
Run a test print
Install printboy
- Install node
- Run
npm install @gauntface/printboy
- Run
cd node_modules/@gauntface/printboy
- Run
npm run setup
- Look at the output for the pm2 command to setup startup
Optional: Install Reverse Proxy
Run
sudo apt update && sudo apt install nginx
Run
sudo nano /etc/nginx/sites-available/default
Change the
location / {
block to use:location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; proxy_pass http://localhost:1314; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_cache_valid 5m; }
Check for errors with
sudo nginx -t
Restart with
sudo systemctl restart nginx