Scanner -> printer problem

Raymond A. Ingles (inglesra@frc.com)
Thu, 8 Apr 1999 09:17:14 -0400 (EDT)

I've been trying for a while to get my scanner and printer to cooperate
and act like a copy machine. I've got a small script that I've hacked in
various ways, but no matter what I try, I can't get the scale quite right.

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 used a ruler and made centimeter marks on a page, horizontally and
vertically. When I scan things in, though, I get an image where the
vertical axis is "squashed" a bit. Instead of 100%x100%, it's more like
100%x91%.

But that's not the most annoying. Even if I compensate for this, I just
can *not* get my printer to produce output that matches the input. No
matter what I do, the "centimeters" on the printed page are either smaller
or larger than the original. Once, I managed to get the horizontal
centimeters to match up, but then the vertical axis was squashed.

Anyway here's the 'xerox' script I've tried:

-----------------------------------------------
#!/bin/sh
# Device to scan from
DEV=mustek:/dev/scanner
# 300 dpi
RES=300
# Next 4 measurement are in millimeters
LEFT=5
TOP=5
WIDTH=205
HEIGHT=255
# From the pnmtops man page
SCALE=.25
# The actual command: scan -> pnmtops -> lpr
scanimage -d ${DEV} -l ${LEFT} -t ${TOP} -x ${WIDTH} -y ${HEIGHT} \
--resolution --mode Lineart ${RES} | \
pnmtops -dpi 300 -center -rle -scale ${SCALE} | \
lpr
-----------------------------------------------

I have also tried things like:

convert -geometry 100%x100%\! -density 300x300 -page 2400x3300+0+0 \
/tmp/xerox.ppm /tmp/xerox.ps
lpr /tmp/xerox.ps

Does anyone have any suggestions or ideas on what I might try? I know
that I'm not going to get a perfect copy, but the divergence I'm seeing is
really annoying. There are some plans and things I'd like to "xerox" where
scaling is disastrous. And dang it, it should be possible to get darn
close with this equipment.

Sincerely,

Ray Ingles (248) 377-7735 ray.ingles@fanucrobotics.com

If all the muscles in your body pulled in the same direction, you
could lift over twenty tons. But you'd walk funny. - L. M. Boyd

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