Having just spent something in excess of three days of my life getting a couple of laser printers to work in Linux, I thought that I'd document what I learned. Maybe this will help some others.
I decided five or six years ago that NT based Windows probably never will be an especially good desktop operating system. Relative to Windows 9, it's too complex, too proprietary, largely undocumented, increasingly user hostile, and way too hard to work on. It is also hopelessly insecure -- in some ways even worse than Windows 9. Neither do I think it will evolve into a really good personal computer OS, although its doing so is unlikely, not impossible.
Before one can abandon Windows, one needs an alternative.
Until recently, I felt that Linux not ready for serious use on the desktop. That's changed. Linux still has flaws, but I think that now -- in 2007 -- Linux has caught up to Windows in usability. It's better in most respects. It still lags in a few areas -- including hardware support and printing. But I'm fairly sure that the problems will be overcome.
So, I'm switching from Windows to Open Source Software -- an process that I think will take several years to fully execute.
So, I have Slackware 11.0 running. I've overcome the problems in accessing the built in wireless on my new AcerPower-1000 PC. The only problem remaining before I tackled major job of reorganizing my computer related activities to use non-Windows software (not much of what I use runs acceptably under WINE) was that neither of the household laser printers worked with Slackware.
There are a number of approaches to Unix printing. A decade ago they were virtually unusable except for simple ASCII documents and -- on good days some expensive Postscript printers. Printing has gotten better. Much better. It's still not as good as Windows. And Windows is far from perfect.
The best of a still somewhat rum lot is CUPS (Common Unix Printing System/Can't Usually Print Stuff -- take your pick). It often works. Sometimes it doesn't. When it does not work, fixing problems is very difficult.
I should point out that there are two components to CUPS although no attempt is made to make that clear to the user. Part of CUPS is a spooler/router that manages print jobs; gets them to the proper destination in a rational order; etc. The other part of CUPS is a bunch of software that converts a desired printout into a printable file that can be fed into the spooler/router. The spooler/router seems to me to be usable albeit sometimes a bit idiosyncratic. It may well be ready for prime time -- at least in home and small business installations.
My problems were with print file creation.
The CLP-300 is an inexpensive color laser printer from Samsung. It comes in a vanilla -- USB connected version, and an N version with more memory and a Network port. We have the N model, but I believe that most of what I have to say would apply equally to it's non-network enabled sibling. The Samsung site seems to indicate that there might be a third -- DSL -- version. If it exists, I'd imagine that it would have the same problems.
The CLP-300(N) arrives with a CD full of software. There are both Windows drivers and Linux 'drivers'. The Windows drivers work fine with both Windows 9 and Windows XP. The Linux drivers did not appear to work with anything. I'll expand on that in a while. A second CD is provided with 'network software'. I have never looked at it. [Update Nov 2009. I have looked at it and have determined that the Windows Sync Thru tool will not install under Wine. That is largely irrelevant as the printer can be configured and checked through its http interface. Exception: Checking toner levels require SNMP and the Linux Smartpanel tool that is supposed to do that ... surprise ... doesn't work.]
The HP-IIP is an ancient, slow, but still quite usable, printer. The HP-II and the similar HP-III printers have been around for more than a decade and are largely responsible for Hewlett-Packard's reputation for building nearly indestructible small laser printers. They actually use Canon laser engines -- HP did the electronics and packaging.
The problem with the HP-IIP under Linux is that it uses an early version of HP's PCL printer language. Generic Linux PCL filters often do not work with the HP-IIP (I'd guess that they don't work with the HP-II either). In my case, the HP-IIP worked in kubuntu, but printed only blank pages in Slackware.
There are actually three possible sets of 'drivers' (filters) for the CLP300.
CUPS works roughly like this. A Linux program wants to print. It creates a print file in some reasonable (to it) format. CUPS' goal is to get the content of that file to the printer in a format that the printer will understand. There are a very large number of printer formats. Unfortunately, the Samsung CLP300 does not understand any of the widely used formats -- ASCII, PCL, or Postscript. The CLP300 wants the page in a format variously called SPL (Sharp, or maybe Samsung, Printer Language) or QPDL. This problem of needing a special format is not limited to the Samsung printers. It's pretty common actually. CUPS deals with these issues by using a chain of programs called 'filters' that convert from program output formats -- usually ASCII or Postscript -- to printer formats.
Geeks might want to know, a QPDL/SPL page is a compressed bitmap that uses dynamic compression algorithms on vertical bands of data. It appears that there are several compression algorithms built into the language and that some may quite likely still be under development. Thus, an SPL printer may be a moving target for a driver author. Isn't that just dandy?
There is a (partial?) description of SPL/QDPL available on the splix website http://http://splix.sourceforge.net/.
The key to getting CUPS to work with a given product is providing CUPS with a Postscript Printer Description (PPD) file that describes what the printer needs. A filter to convert the printout from a known format to the format needed by the printer will be required if the filters distributed with CUPS won't do the job. Shorn of a zillion details (many of them important) there usually is a line buried in the PPD file that says to CUPS in effect -- 'If you can get your printout into this format that you and I both understand, here's a filter (driver) that will output a print file that the printer will love'. Typically the line will look like 'application/vnd.cups-raster 0 xyz' or 'application/vnd.cups-postscript 0 xyz'. These lines say to CUPS, you get the printout into raster (or in the second case postscript) format and xyz will take it from there.
CUPS will use the PPD to come up with a filter chain that converts the program output to the format needed by the printer. CUPS will take the output of the filter(s) and route it to the printer.
Bottom line: In order to use CUPS to print to a Samsung CLP300 printer, you need a suitable PPD file and a you need to install a filter that outputs SPL/QPDL in a place that CUPS can find it.
Conceptually one just needs a PPD file (CLP-300splc.ppd) and a filter(ppmtosplc). However Samsung approaches this in a somewhat byzantine fashion. They give the user 38mb of software on the CD. (You can also download the software from the support section of the Samsung Web Site -- which renders in a difficult to use fashion in Firefox incidentally). Buried in the software is a script called setup.sh that must be run. You can also run the autorun file which will invoke setup.sh. Autorun's job is to start setup.sh if the Samsung software is burned to a bootable cd. Setup.sh -- if it runs -- detects that you are on Linux and moves a full set of drivers for all Samsung color laser printers into what it feels to be appropriate directories. It also installs configuration software and creates a file called linuxprint.cfg in the /etc directory. Setup.sh is needed because the ppmtosplc 'driver' uses linuxprint.cfg in order to generate a printout.
Setup.sh may or may not run. It appears to be dynamically linked to several libraries that may or may not be installed on a given Linux distribution. It does not seem to run well with more recent versions of the libraries. In my case, setup.sh ran sometimes on Slackware 11, and never on Kubuntu.
The problem with all this is that ppmtosplc, once installed, often doesn't work. When run -- either stand alone or via CUPS -- it, at best, outputs an unhelpful message "Could not find a suitable printer!!!" and exits. No one seems to know exactly what that message means. My somewhat educated guess is that it means ppmtosplc can not find (a) file(s) that it uses to find its printer data or doesn't like what it finds there. Again, guessing, quite likely this is due to a defective /etc/linuxprint.cfg file. In support of that theory, I found that the ppmtosplc filter wrote a new /etc/linuxprint.cfg file without a <PRINTER> section whenever it reported that it could not find a suitable printer.
Unfortunately, the format of linuxprint.cfg is not documented. Neither is the ppmtosplc software. The source for ppmtosplc which would probably make it clear what the problem is, is not provided. The binary of ppmtosplc is compiled without the symbol tables that might make running a debugger to find out what is going on tolerable.
I was eventually able to persuade setup.sh to run to completion on Slackware 11.0. I was then able to run Samsung's linux-config software to set up a printer on /dev/lp0. I then used CUPS to modify that printer to use the correct network port. At that point, I was able to print a CUPS test page. None of this was especially easy.
My conclusion. By all means try the Samsung software, but don't be suprised if it doesn't work. If it doesn't work, don't waste time with it unless you can't use the foo2qpdl driver discussed below for some reason.
SAMSUNG DRIVERS -- MANUAL INSTALLATION
July 25,2007. I finally got a chance to do a manual install of the Samsung drivers for the CLP300N. The install was on Slackware 12.0. The following is not exactly what I did. More like what I'll try to do next time. But it should be correct or very close to correct. I did end up with a working installation.
<?xml version="1.0"?>
<linux root="/etc/cups/ppd/" system="cups">
<option name="ghostscript" value="/usr/bin/gs"/>
<option name="address" value="localhost"/>
<option name="port" value="631"/>
<option name="lpr" value="/usr/bin/lp-cups"/>
<printer ppd="CLP-300splc.ppd" queue="CLP300N">
<option name="ColorModel" value="RGBA"/>
<option name="Resolution" value="1200x600"/>
<option name="PageSize" value="Letter"/>
<option name="InputSlot" value="AUTO"/>
<option name="MediaType" value="Normal"/>
</printer>
<option name="llpr-default-printer" value="CLP300N"/>
</linux>
Notes 3 and 4
NOTE: Conceptually, the foo2qdpl driver can be downloaded from **http://foo2qpdl.rkkda.com**, however, repeated attempts to contact that site in Dec 2009 timed out. Here's the Internet Archive Link to the latest archived version of information on the driver (Aug 2008). The driver can apparently be called either **foo2qdpl or foo2zfs**. I'm hazy on the difference (if any).
On Slackware 11.0, the HP-IIP printed only blank pages. Tinkering with the printer parameters (e.g. greyscale printing) that might, conceivably, be responsible didn't help. So I simply went to http://www.linuxfoundation.org/collaborate/workgroups/openprinting (which, by the way, does not seem to be working properly this morning as the only HP printer that it seems to know about is the DJ693A. I imagine that it will work better within a few hours or days). I found a different 'driver' for the HP-IIP. I downloaded the ljet2p.ppd ppd then set up a new CUPS printer to use it. It worked perfectly. The only difficulty I encountered was my failure to recognize quickly that all I needed was the PPD file because the necessary filter (foomatic-rip) was already installed.