cat FILE > /dev/lp0 finally works!
I thought I'd post this here because it took me so long to get it working and I might save someone else a big headache.
I bought a Samsung ML-1660 printer recently, a monochrome laser printer that was on sale for $69. I immediately tested it out with XP and it prints beautifully, but the paper feed is a bit wimpy and tends to slurp up multiple sheets on larger print jobs. No big deal, I don't intend to be printing out huge manuals and stuff anyway.
In linux, I have no idea why, but CUPS has never worked properly. It's so convoluted and nearly impossible to configure correctly. So after messing with that for quite a while, downloading fresh source, etc I finally gave up on it.
Samsung has a Unified Linux Driver on their site, so I downloaded it and checked it out. It is totally based upon the assumption that you have CUPS working. Too bad for me.
After MUCH messing around, this is what I discovered:
Whatever FILE you want to print, convert it to postscript. The is a multitude of converters (ImageMagick, pdftops, enscript, et al) that are pretty much standard on every linux distro.
The only files you need from the Samsung driver package are:
raster2samsungspl (a binary)
ML-1660.ppd (a text file)
Strangely enough raster2samsungspl _requires_ 6 command line arguments:
6. and last but not least, the FILE.ps
All of these arguments are completely ignored, but are also completely required, so you can go:
And it does nothing. No complaint. Nothing. Just fails silently.
raster2samsungspl 1 1 1 1 1 FILE.ps
So, even that is not enough to convert FILE.ps into the FILE.spl that the printer needs to do it's job.
After using a hexeditor on raster2samsungspl, I discovered an error string near the end of it:
AHA! You need to tell it where the FILE.ppd is too. Why doesn't say that? God only knows. If it expects you to have CUPS running, why doesn't it look in /etc/cups/? I dunno.
PPD ERROR: Environment variable PPD undefined or empty?
So now we have the command:
And we finally have many pages of gibberish dumped to the screen. We're getting close...
export PPD=/etc/cups/ml1660.ppd raster2samsungspl 1 1 1 1 1 FILE.ps
Modify that to go:
And WOW! I now have a file that prints in full monochrome glory!
export PPD=/etc/cups/ml1660.ppd raster2samsungspl 1 1 1 1 1 FILE.ps > FILE.spl
And then I went and upgraded ghostscript from 7.07 to 8.01 for a reason I cannot remember, and the whole thing broke. Postscript files were now unusable so the printer driver coughed errors and failed.
cat FILE.spl > /dev/lp0
In using gsview to look at the PSFILEs, it always complained about missing fonts and failed also.
Ghostscript needs a Fontmap in /usr/local/share/ghostscript/8.01/lib/
and, oh boy, it is not forgiving about that one. You also need to tell it where to find the thing too. It's not good enough just to export the GS_LIB and stuff like the manpage says, you have to tell the individual programs that use gs where to look.
So now our print command goes like this:
And you have FILE.spl that you can happily type:
export PPD=/etc/cups/ml1660.ppd \
raster2samsungspl 1 1 1 1 1 FILE.ps \
as many times as you want for as many copies as you want and it _actually_ prints.
cat FILE.spl > /dev/lp0
Woo hoo! (Do a little jig and kiss the wife)
I hope someone else can avail themselves of this information.