Version 28 (modified by 20 months ago) (diff) | ,
---|
Printer Forwarding
This feature allows printers connected to the client to show as virtual printers on the server.
This functionality shares most of the code with the file transfers feature, as the print job is first rendered to a file before being sent to the client.
Installation and platform support
- MS Windows and OSX clients (10.6 onwards) should work out of the box
- CentOS requires manual setup to support OSX clients as the cups-pdf package is not available in the default repositories
- Debian and Ubuntu: the dependencies are listed as "suggestions" only, so you may need to run
apt-get install cups-filters cups-common cups-pdf python3-cups
to install the missing pieces - you may encounter some permission issues: the user running the xpra server must be a printer administrator - whatever group that may be (if you need to add your user to a group you will also then need to logout and login again):
- for Fedora and centos the sys group:
gpasswd -a $USER sys
- for Debian and Ubuntu the lpadmin group:
usermod -a -G lpadmin $USER
- for Fedora and centos the sys group:
- the cups backend installed must have
0700
permissions:chmod 700 /usr/lib/cups/backend/xpraforwarder
- SELinux can cause problems: either disable it or use the "cups_xpra" policy add-on (see #815)
- forwarding is only supported to a Posix server, support for MS Windows and OSX as servers may be added in the future.
- OSX clients use Postscript (#995), other clients use PDF for transport
- do not use socket authentication on your local sockets (see #1286)
Implementation
How does this work? The xpra client exports the list of local printers to the xpra server, the server can then create the same list of virtual printers using the "lpadmin" command. Those virtual printers are actually PDF or postscript scripts. When the user sends a print job to one of those virtual printers, the script captures the rendered document and forward it to the client who owns this particular printer. The xpra client then sends this PDF / postscript document straight to the printer.
The HTML5 client is written in Javascript so it does not have access to the printer device information and the PDF document is presented for printing via the standard browser's print dialog.
Mac OS Shadow Server Support
The default configuration of Mac OSX starting with version 10.10 (aka Yosemite) prevents the xpra cups backend from connecting to the xpra server, to fix this run:
sudo sh -c 'echo "Sandboxing Relaxed" >> /etc/cups/cups-files.conf' sudo launchctl stop org.cups.cupsd
Debugging
- run the xpra/platform/printing.py script to see which printers are detected (this script is available as
Print.exe
on MS Windows and asXpra.app/Contents/Helpers/Print
on OSX) - you can use the same script to print files, ie:
./xpra/platform/printing.py /path/to/yourfile.pdf
- run the client and server with the
-d printing
debug flags (see wiki/Logging) - look for the cups backend messages in your syslog (ie: with journald:
sudo journalctl -f -t xpraforwarder
) - more details here: ticket:913#comment:14
- for debugging the cups server backend, run:
cupsctl --debug-logging