Re: Scanner -> printer problem

Andreas Dilger (adilger@enel.ucalgary.ca)
Thu, 8 Apr 1999 09:49:35 -0600 (MDT)

You write:
> I've got a Mustek scanner that I use with SANE (at 300dpi, lineart mode)
> and an HP DeskJet 600 printer (used at 300dpi again). SANE spits out a
> PPM-format file.
>
> I've tried using "pnmtops" (from the netpbm package) and "convert" (from
> ImageMagick) to produce a postscript file that then goes through
> magicfilter. I *thought* I read the man pages appropriately, but the image
> on the paper is not *quite* the same size as the original.

I would avoid the entire ppm->ps->pcl conversion step, since it is possible
to confuse things with the multiple conversions. I'm pretty sure there is
a pbm->pcl filter (pbmtolj), that I use with sendfax, but it may
even be part of the normal netpbm tools. I had set up my magicfilter to
use this instead of going to PS, and then having ghostscript convert back
to raster, because it uses a lot of memory + CPU, and I didn't have a fast
machine back then. Here are the relevant lines in my filter file:

0 P1\n pipe /usr/local/bin/netpbm/pbmtolj -resoution 300 2> /dev/null
0 P2\n pipe /usr/local/bin/netpbm/pgmtopbm 2>/dev/null
0 P3\n pipe /usr/local/bin/netpbm/ppmtopgm 2>/dev/null
0 P4\n pipe /usr/local/bin/netpbm/pbmtolj -resolution 300 2> /dev/null
0 P5\n pipe /usr/local/bin/netpbm/pgmtopbm 2>/dev/null
0 P6\n pipe /usr/local/bin/netpbm/ppmtopgm 2>/dev/null

As you can see, it converts color/grayscale to b&w first, and then prints.
Now, this works fine with my LaserJet, but I'm not 100% sure on the DeskJet
if it supports PCL. If it doesn't, you may need to use a different back-end,
but it is relatively easy to do, since the data is guaranteed to be in raster
format, which the printer can handle, with a few codes.

Cheers, Andreas

-- 
Andreas Dilger   University of Calgary  \"If a man ate a pound of pasta and
                 Micronet Research Group \ a pound of antipasto, would they
Dept of Electrical & Computer Engineering \   cancel out, leaving him still
http://www-mddsp.enel.ucalgary.ca/People/adilger/       hungry?" -- Dogbert

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com