2

I like the way simple-scan produces small pdf files for text documents. Alas, since I upgraded to Ubuntu 17.10 (and still on 18.04), the keys C-1 (scan 1 page) and C-n no longer work, so I have to move the mouse (which is slow), so I am looking for alternatives.

Compile pdf file from multiple images scanned in by scanimage --batch and Scanning from terminal offer an excellent approach:

$ scanimage --format=tiff | convert tiff:- scan.pdf

Alas, the file scan.pdf is 10M - for a page which is scanned by simple-scan into a 164k PDF file.

I tried all combinations:

for mode in gray line; do 
  for format in png tiff jpeg; do 
    scanimage --mode $mode --resolution 300 --format=$format | convert $format:- $mode-$format.pdf
    ls -h $mode-$format.pdf
  done
done

and got

5.9M gray-png.pdf
11M  gray-tiff.pdf
1.1M gray-jpeg.pdf
288K line-png.pdf
11M  line-tiff.pdf
1.5M line-jpeg.pdf

IOW, the only options producing decent file sizes are --mode line --format png.

However, the quality of the scan leaves a lot to be desired (e.g., all lines are the same weight - black, there is no gray scale, lots of "dirt"). gray produces decent quality, but the file sizes are absurdly huge.

So, how do I scan a text document into PDF the way simple-scan does in text mode without using my mouse?

PS. I asked this on Unix and got no answers.

sds
  • 2,543

0 Answers0