scan via commandline

For the first time I needed to use the scanner of my Kyocera ECOSYS M5526cdn. It is connected to the network, so I had a couple of options, like scanning to a samba share, sending via mail and scan via wifi. But I didn’t want to setup something complicated, so I opted for the 3rd option.

For that to work, sane-airscan was needed as it adds airscan support to sane, the scanning tool.

When in the same network segment as the printer, check the URL of the scanner: scanimage -L.

Take the URL and check the options of the scanner (like colors, duplex scan, …).

scanimage -d 'airscan:e0:Kyocera ECOSYS M5526cdn' --help

Important is to use airscan instead of escl. Escl has trouble with duplex scanning with this printer.

Then to scan, add all the options that are required:

scanimage --device-name 'airscan:e0:Kyocera ECOSYS M5526cdn' \
    --source 'ADF Duplex' \
    --mode color \
    --batch \
    --format png

This will output all scanned pages each as a png file in the same directory.