Scanning from terminal

Post tutorials, HOWTO's and other useful resources here.
Kulle
Warlord
Warlord
Posts: 594
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

Scanning from terminal

Post#1 by Kulle » 31 Jul 2022, 15:03

Scanning from terminal

scanimage is a command line tool, in the sane-utils Debian package
It is therefore installed by default in many distributions, including Porteus.

With the command scanimage -L you can first test whether the scanner is recognized in the distribution.
E.g. my scanner is not recognized in Porteus 5.0.

If the scanner has been detected, you can use scanimage -A to see all the options that can be used for the scanner.

The commands for scanning look like this:
scanimage > picture.pnm
scanimage > document.jpg
scanimage --format=tif --resolution 300 > /tmp/doc.tif

Linux man page:
https://linux.die.net/man/1/scanimage

A disadvantage: pdf is not supported.
So you have to convert if necessary, e.g. with ImageMagick