Console utilities in Linuxes are cool: mcabber for jabber, mutt for mail, mocp for music, vim to rule them all! This note is about scanning from the console (I assume your scanner is already set up). The aim is to scan a document with good quality into a PDF with a reasonable size.
Scanning is done by the scanimage utility:
1scanimage --resolution 300 --mode Color --format tiff > document.tiff
If there is more than one scanner in your system, list them all with the scanimage -L command and use the specified name with the --device-name argument.
The next step is to convert the tiff into a PDF image. It can be done with imagemagick:
1convert document.tiff document-big.pdf
But the resulting PDF is too big and must be reduced. I’ve found the shrinkpdf bash script very helpful for this purpose, with one correction: IMHO 72 DPI resolution is too small, so I’ve changed it to 300 DPI. The essential part of that script is the ghostscript call:
1gs -q -dNOPAUSE -dBATCH -dSAFER \
2 -sDEVICE=pdfwrite \
3 -dCompatibilityLevel=1.3 \
4 -dPDFSETTINGS=/screen \
5 -dEmbedAllFonts=true \
6 -dSubsetFonts=true \
7 -dColorImageDownsampleType=/Bicubic \
8 -dColorImageResolution=300 \
9 -dGrayImageDownsampleType=/Bicubic \
10 -dGrayImageResolution=300 \
11 -dMonoImageDownsampleType=/Bicubic \
12 -dMonoImageResolution=300 \
13 -sOutputFile=document.pdf \
14 document-big.pdf