home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / libsane / examples / xerox < prev   
Encoding:
Text File  |  1999-08-09  |  1.2 KB  |  61 lines

  1. #!/bin/sh
  2. #
  3. # This is a xerox script for Laserjet Printer.
  4. # To get use of Postscript change the Printercommand and enable the
  5. # command at the end of this File.
  6. #
  7. DEV=mustek:/dev/scanner
  8. RES=300
  9. PAPERTYPE=letter
  10. #PAPERTYPE=a4
  11. PRINTERTYPE=ps
  12. #PRINTERTYPE=lj
  13. #
  14. # Non-printable area (left, right, top, and bottom margins):
  15. #
  16. LMARGIN=0.0
  17. RMARGIN=0.0
  18. TMARGIN=0.25
  19. BMARGIN=0.0
  20. #
  21. # Scanner-specific options:
  22. #
  23. DEVOPTS="--mode Gray"
  24. #DEVOPTS="$DEVOPTS --custom-gamma=yes --gamma-table [0]0-[64]128-[255]255"
  25. #DEVOPTS="$DEVOPTS --backtrack=yes"     # needed for Mustek 12000SP
  26. #
  27. # Printer Command/Resolution
  28. PRES=$RES # change this if other Res. is desired
  29. #
  30. # Papersize in inch
  31. if [ "$PAPERTYPE" = "letter" ]; then
  32.   WIDTH=8; HEIGHT=10
  33. else
  34.   # assume a4 paper
  35.   WIDTH=8.27; HEIGHT=11.69
  36. fi
  37.  
  38. SCANWIDTH=`bc <<_EOF_ 
  39. scale=3
  40. $WIDTH-$LMARGIN-$RMARGIN
  41. _EOF_`
  42. SCANHEIGHT=`bc <<_EOF_ 
  43. scale=3
  44. $HEIGHT-$TMARGIN-$BMARGIN
  45. _EOF_`
  46. #
  47. SCALE=`bc << _EOF_
  48. scale=3
  49. 75/$RES
  50. _EOF_`
  51.  
  52. if [ "$PRINTERTYPE" = "ps" ]; then
  53.   POST="pnmtops -rle -scale $SCALE -dpi $PRES | lpr"
  54. else
  55.   POST="pgmtopbm | pbmtolj -resolution $PRES | lpr -Praw"
  56. fi
  57.  
  58. scanimage -d $DEV \
  59.     -x $SCANWIDTH\" -y $SCANHEIGHT\" -l $LMARGIN\" -t $TMARGIN\" \
  60.         --resolution $RES $DEVOPTS | eval $POST
  61.