|
Linux's Witness Ministry
|
# cxerox - version 1 - 1998.11.29 - Chris X. Edwards
# Program to send scanned input to the printer
# ============================================================
# cxe- This program fires up the scanner and guides it's output
# cxe- through the conditioning utilities until it winds up on paper.
# cxe- This program is an excellent example of shell pipes. Most of
# cxe- the commands that I use expect a file as input and expect to
# cxe- write one as output. I redirect their attention to the standard
# cxe- input/output (the pipes) by using dashes where a normal file
# cxe- name usually goes.
# cxe- The first part scans the image. Mode is probably important
# cxe- and the resolution should match the printer. The -y parameter
# cxe- can be used to limit the scan area (in milimeters).
# cxe- A value of 170 was good for a certian manual, 280 is 11 inches.
# cxe- The next part converts the scanner's output which was .pnm
# cxe- to PostScript. There are lots of other fun things that could
# cxe- be added at this point - rotate, or scale for example.
# cxe- This translates the Postscript data to something that the
# cxe- HP DeskJet500 can understand. This is my printer and it is
# cxe- fortunate that 'gs' supports it just fine.
# cxe- Finally, the data is piped to the printer. Cross your fingers!
# cxe- Note that this is all one line and it seems to need to be on
# cxe- consecutive lines. This may or may not be true, but there is
# cxe- definitely some bash peculiarity at work. Like no characters
# cxe- are permitted after a '\' for it to be a line continuer.
scanimage --mode Lineart --resolution 300 -y 280 | \
convert - PS:- | \
gs -sDEVICE=djet500 -q -NOPAUSE -sOutputFile=- - | \
lpr
| Return to Main Page *** Return to Linux Notes Index |
| This page was created with only free, open-source, publicly licensed software. This page was designed to be viewed with any browser on any system. |
| Chris X. Edwards ~ February 1999 |