Setup a Fujitsu ix500 scanner on Linux

Install package

sudo apt install sane-utils -y

Approve the connection

Enable the scanner by opening the scanner’s lid

sudo sane-find-scanner -q
found USB scanner (vendor=0x04c5 [Fujitsu], product=0x132b [ScanSnap iX500]) at libusb:001:007
found USB scanner (vendor=0x0424, product=0x7800) at libusb:001:005

Get a list of devices:

scanimage --list-devices
device `fujitsu:ScanSnap iX500:10443' is a FUJITSU ScanSnap iX500 scanner

Get a list of all device specific options:

scanimage --device 'fujitsu:ScanSnap iX500:10443' --all-options

Scan a test file

Scan with default settings to a temporary testfile

scanimage --format=tiff > /tmp/image.tiff
ls --size --block-size=M /tmp/image.tiff
5M /tmp/image.tiff

Scan productively

Mind making this script executable using chmod +x.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#Content of ~/scripts/scan.sh
if [ $1 -eq 0 ]
then
    OUT_DIR=/tmp
else
    OUT_DIR=$1
fi
fileNAME=scan_`date +%Y-%m-%d-%H%M%S`_

echo 'scanning...'
scanimage --verbose\
          --page-width 221.121\
          --page-height 876.695\
          -l 0\
          -t 0\
          -x 221.121\
          -y 876.695 \
          --ald=yes \
          --overscan On \
          --prepick=On \
          --mode Gray \
          --resolution 300 \
          --source 'ADF Duplex' \
          --swcrop=yes \
          --buffermode On \
          --swdespeck 2 \
          --swdeskew=yes \
          --swskip 20% \
--device 'fujitsu:ScanSnap iX500:10443' \
         --batch="$OUT_DIR/$fileNAME%03d.tiff"
printf "Scanned document(s) to:\n\
           $(ls --size --block-size=M $OUT_DIR/$fileNAME*)"

Code Snippet 1: Scan documents in bash with scanimage
scanning...
Scanned document(s) to:
           9M /scan_2020-03-22-205607_001.tiff
9M /scan_2020-03-22-205607_002.tiff

Skipping empty pages

Pay attention at the highlighted swskip in the script above. Lower values e.g. 5% almost never skip empty pages. You get two files (double sided document). Higher values e.g. 20% skip empty pages. You get one file. Case-specific testing is recommended.

scanimage --help | grep swskip --after-context=1
    --swskip 0..100% (in steps of 0.100006) [0]
        Request driver to discard pages with low percentage of dark pixels

Alias the command

Add this command to your .profile

alias scan="ssh raspi '/home/pi/scripts/scan.sh /media/pi/usb500gb/scan'"