Printing
Available since: brezel/api@2.11.x
You can print documents from Brezel using workflows and action/print.
This utilizes the https://github.com/rawilk/laravel-printing library and the CUPS printing system.
Setup a CUPS server
- Install CUPS on a server that is in the same network as your printer.
sudo apt install cups
- Start CUPS
sudo systemctl start cups
and enable it to start on bootsudo systemctl enable cups
- If you are using WSL2, use
sudo service cups start
to start CUPS. Remember, you need to to this every time you restart WSL2!
- If you are using WSL2, use
- Find out your printers IPP address.
- It can be found in the printers settings or by printing a network configuration page.
- The printer might give you the address in the format
http://...
orhttps://...
. You need to convert it toipp://...
.
- Add your printer to CUPS. This has to be done only once.
sudo lpadmin -p A_NAME_FOR_YOUR_PRINTER -m everywhere -o printer-is-shared=true -E -v ipp://THE_IPP_ADDRESS_OF_YOUR_PRINTER
- Example:
sudo lpadmin -p epson -m everywhere -o printer-is-shared=true -E -v ipp://192.168.2.44:631/ipp/print
- Optionally validate your config by running
sudo lpoptions -d A_NAME_FOR_YOUR_PRINTER
- Now get the url to your CUPS instance
- Example:
http://localhost:631
-
This is the URL you will use in the configuration of your Brezel
- Example:
- Get the id (url in CUPS) of your printer. You can find it in the CUPS web interface at
http://localhost:631/printers/
.- Example:
ipp://localhost:631/printers/epson
-
This is the printer id you will use in the configuration of your Brezel
- Example:
Configure in Brezel
Set the env variables
CUPS_SERVER_IP=your-cups-server-hostCUPS_SERVER_PORT=631PRINT_DEFAULT_PRINTER_ID=ID_OF_YOUR_PRINTER
With the example above, if I want to use the printer epson
on the CUPS server at http://localhost:631
, I would set the following env variables:
CUPS_SERVER_IP=localhostCUPS_SERVER_PORT=631PRINT_DEFAULT_PRINTER_ID=ipp://localhost:631/printers/epson
Secure your CUPS server
You can also use a username and password to secure your CUPS server. Set the following env variables in brezel if you configured this:
CUPS_SERVER_USERNAME=your-usernameCUPS_SERVER_PASSWORD=your-password
Usage
Put a File entity into the input of an action/print
workflow element and watch the magic happen.