Samba + CUPS + Printing from Windows and Linux

My OKI B4100 PCL printer is connected to my Debian server and I want it to accept print jobs from remote Windows and local and remote Linux. CUPS and Samba need to be installed and RAW printing needs to be enabled in CUPS (see below).

For the CUPS server (using the CUPS web interface) and the Linux CUPS client (kdeprint in my case) I selected the printer “HP LaserJet Series CUPS v1.1” and set it to 600dpi. Now any incoming print job that is not in RAW format will be converted to PS first, then to PCL and sent to the printer. Foomatic is not needed, the Laserjet PPD file is included in Debian cupsys package. Local printing using lpr on the CUPS server works fine, as well as Remote CUPS, Remote LPD or Samba printing from KDE using the same PPD file. PCL is created on the client and the CUPS server is just used for spooling.

Printing from KDE using a generic Postscript driver only works over Samba. Remote LPD and IPP are not working, the CUPS server detects incoming PS files as application/vnd.cups-raw instead of application/postscript.

OKI’s Windows drivers send print jobs in RAW PCL format and therefore need CUPS to pass through the PCL file. This works fine.

Samba shares all CUPS printers automatically with this smb.conf entry:

comment = All Printers
browseable = yes
path = /tmp
printable = yes
public = yes
writable = yes
create mode = 0777
use client driver = yes

Furthermore it needs the following entries in the global section:

printcap name = cups
printing = cups

For CUPS RAW printing setup see section 4.3 of this document.

Unfortunately, setting printer options in Windows is awfully slow when printing over Samba. Opening any printer related dialog puts heavy load on my Debian server and delays the dialog, as it queries the server for the printer capabilites. So I decided not to print from Windows using Samba, but using the remote LPD queue provided by CUPS: Install UNIX printing services in XP and run the add printer wizard. Create a new LPR port here, enter print server name or IP address and CUPS printer name as queue name and choose the B4100 Windows driver. Now the delay in the printing dialog is gone, and the prints have a smooth 600 dpi!

This is another valuable resource for CUPS.