Scanning to Debian 12 with a Fujitsi ix500

I have a lot of documents to scan.

I have a working Brother multi-function printer/scanner, and it works fine, but it scans slowly. Very slowly.

I also have an old(ish) Fujitsi ix500, a preference for using Linux, and a willingness to give something a try.

And… it works, very easily!

Using GNOME’s “Document Scanner”

This was as simple as plugging in the ix500 using the USB cable, and then opening “Document Scanner”.

I could immediately use the scanner, including duplex, and setting options.

It has a post-processing function, but I didn’t make that work (or spend too much time trying).

If I wanted to scan the occasional document, this is probably the way to go.

But I have many, many documents, to scan.

Using scanimage

Because I have so many documents to get through, I wanted a solution which used the button on the scanner, and automatically saved the output as a PDF.

I wanted duplex, and I’m willing to accept blank pages.

Install and configure scanimage

I installed scanimage using:

sudo apt install sane-utils -y

To identify the scanner (after I had plugged it in and powered it on), I used:

scanimage -L

That gave me fujitsu:ScanSnap iX500:1224166.

I used that to check the options available for my scanner, using: scanimage –help -d ‘fujitsu:ScanSnap iX500:1224166’

scanimage --help -d 'fujitsu:ScanSnap iX500:1224166'

It gave me a whole list of options. Of interest to me were source, to set duplex mode, and resolution.

Shell script for the scanning

I wrote a simple shell script, to handle the scanning. I load the pages into the document feeder, and then run the shell script.

To set it up, I created the output directory, in which the converted PDFs will be placed:

sudo mkdir /var/scans_out
sudo chown -R neil:neil /var/scans_out

Here’s the shell script:

#!/bin/bash
set -e

OUTPUT=$(date +%Y%m%d%H%M%S).pdf
SCANDIR=$(mktemp -d)
OUTPUTDIR='/var/scans_out'

cd "$SCANDIR"

scanimage -b --format png  -d 'fujitsu:ScanSnap iX500:1224166' --source 'ADF Duplex' --resolution 300
convert ./*.png "$OUTPUTDIR"/"$OUTPUT"

# This might be unnecessary
rm "$SCANDIR"/*.png

To use it, save it somewhere, then chmod +x it.

When run, it scans, using duplex (i.e. both sides), and saves the output images into $SCANDIR, before converting them to PDFs and storing them in $OUTPUTDIR.

Scanning using the ix500’s button

To scan using the ix500’s button, I installed scanbd.

I installed it with:

sudo apt install scanbd -y

In /etc/scanbd/scanbd.conf, I deleted all the action settings other than the action for Scan to file. I edited this to read:

        action scan {
                filter = "^scan.*"
                numerical-trigger {
                        from-value = 1
                        to-value   = 0
                }
                desc   = "Scan to file"
                # script must be an relative path starting from scriptdir (see above), 
                # or an absolute pathname. 
                # It must contain the path to the action script without arguments
                # Absolute path example: script = "/some/path/foo.script 
                script = "/home/neil/scripts/scan.sh"
        }

Because scanbd on Debian runs as the user saned (which you can change in /etc/scanbd/scanbd.conf), I needed to change the permissions on /var/scans_out:

sudo chown -R saned:saned /var/scans_out

Now, if you press the button on the scanner, it runs the script.