Re: Scanner -> printer problem

Dr. Andreas Bolsch (Andreas.Bolsch@maths.nott.ac.uk)
Fri, 09 Apr 1999 10:15:44 +0100

The problem is that pnmtops is intended for printing pictures, i.e.
there are provisions for a generous margin and a convenient 'best fit'.

Let's suppose we use a4 paper, that is 210mm x 297mm. The useable height
and width are 95% (margin hardcoded in pnmtops), so 199.50mm x 282.15mm.
If we'd like to center this 'window' we would use e.g.

scanimage -d <device> --mode <mode> --resolution 150 -l5.25mm \
-x199.5mm -t7.425mm -y282.15mm | \

Now 'dpi' must be an integral multiple of 72 for pnmtops (for otherwise
the scaling algorithm does awkward things), and as we scanned with
150dpi here, the scale factor is 72.0 / 150.0 = 0.48, so

pnmtops -scale 0.48 -dpi 72 -width 8.28 -height 11.71 | lpr

does the job. Note that width and height are not used for scaling here,
they just affect the centering (if they're not too small).

This gives for me reasonable copies up to a slight horizontal
distortion (about 1%). The latter, however, is due to mechanical
inaccuracy of the scanner as it's present even in the pnm file.

Of course, as already remarked, this method is rather slow, so in
general pnmtolj is a better choice for b/w copies. However, for
color ...

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