Hi List,
since I've had issues getting client-side printing to work (which I need for low-budget printers that don't support PCL/PS), I built my own work-around.
The following is an explanation on how to turn every printer that is connected to a Windows client into a printer that can be accessed with CUPS, regardless of the print protocol it speaks. IOW: If it can print from Windows, it can now print from CUPS as well, as long as it's connected to a Windows box.
The advantage over using the X2Go built-in solution is that you don't even need a running X2Go client on the particular box - say, in a small two-person office with only one (low-budget inkjet) color printer, with the X2Go user wanting to print something in color, but the pritner is connected to the other machine, and the co-worker currently isn't using X2Go.
Requirements:
On the client computer:
On the server: Any recent CUPS server with CUPS-PDF installed
Log in as root (or run this prefixed with sudo) lpadmin -p "CLIENTNAMEHERE_LPD" -v "lpd://CLIENTDNSNAMEORIPHERE/PDFQueue" -D "Generic Printer" -L "CLIENTNAMEHERE" -E -m "lsb/usr/cups-pdf/CUPS-PDF.ppd"
(everything on one line, substitute clientname and IP where required)
Go to Control Panel/Software, Windows Components and install the LPD Print Service (this may require you to insert installation media or point Windows to the folder with the extracted service pack files)
Check the Services - The TCP/IP-Print Service should be running and set to start automatically - if not, change it so it does.
Download and install RedMon (see above - it's available in several languages, choose the one that suits you best) Be sure to unzip all the files to %ProgramFiles%\RedMon before installing - redmon doesn't do that by itself when you install it, and we need some files from that directory later on
Download and install Sumatra PDF. Do not set it as your default PDF viewer unless this is really what you want. Most users will prefer to use Adobe Reader as the default viewer.
Install a new printer: Local Printer, do not scan for PnP devices Create New Port, Redirected Port, RPT1, Manufacturer: Generic*, Type: Generic/Text Only, Name: "PDFQueue". Double-check that it is not set as the standard printer (or you will create an infinite spooler loop), do not share it, and do not print a test page.
*If you can't find "Generic" or "Standard", press "Windows Update", if that still doesn't help, pick a common printer model like a HP Color LaserJet.
Note that you have to type the language-specific path in *both fields*, say, "C:\Programme\" on a German Windows - substituting %programfiles% doesn't work.
Go to Control Panel/Software, Windows Components and install the LPD Print Service (this may require you to insert installation media or point Windows to the folder with the extracted service pack files)
Check the Services - The TCP/IP-Print Service should be running and set to start automatically - if not, change it so it does.
Download and install RedMon (see above - it's available in several languages, choose the one that suits you best) Be sure to unzip all the files to C:\Program Files\RedMon before installing - redmon doesn't do that by itself when you install it, and we need some files from that directory later on
Download and install Sumatra PDF. Do not set it as your default PDF viewer unless this is really what you want. Most users will prefer to use Adobe Reader as the default viewer.
Attention users of Windows Vista or Windows 7: You need to run cmd.exe with an administrative account and use the following command to start the "Add Printer Wizard" *from within that cmd session* to make this work! rundll32 printui.dll,PrintUIEntry /il
Attention users of Windows Vista or Windows 7: Do *not* double-click on the newly created printer, rather, double-click the printer named "Microsoft XPS Document Writer". (There is no way to open the PDFQueue printer with admin privileges, and attempting any change to the RedMon settings will result in an error message when pressing OK/Apply)
Click on "Printer", "Open as Administrator", then click on "Printer" again, select "Properties", and pick the "Ports" tab.
Configure the RPT1: port. Choose Redirection Program: C:\Program Files\Redmon\redrun.exe "Program handles Output" Run: "Hidden" C:\Program Files\SumatraPDF\SumatraPDF.exe -print-to-default -exit-on-print %1
Attention users of Windows Vista or Windows 7: Be sure to re-select "XPSPort:" for the "Microsoft XPS Document Writer" after you're done (or you will disrupt printing to this printer).
Test:
Printing to the CLIENTNAMEHERE_LPD printer should result in a spool file ending up in the PDFQueue on the client, which disappears again shortly after, another spool file in the queue of your default printer on the client, which also dissapears again shortly after, and a print job coming out of your default printer.
Comments welcome, and if somebody decides *where* in our wiki this should go, I'll be happy to add it there with proper formatting.
Kind Regards, Stefan
PS: I'd still be interested in knowing what's currently going wrong with the X2Go-client's built-in printing support on Windows (see my post at https://lists.berlios.de/pipermail/x2go-dev/2011-December/003133.html). Should be way less of a hassle to configure once it works.