Setting up a legacy scanner with a shiny new Mac

The problem is how to get an old HP ScanJet 3400c (c. 2000) scanner working with a MacBook running OS X 10.6.7 Snow Leopard. Annoyingly I did all this once about 6 months ago but since my Mac got nicked and I didn’t make any notes I’ve now got to remember how to do it all over again.

So, you’ll need some binaries from Mark Ellert’s TWAIN SANE project – install libusb, SANE backend and TWAIN SANE Inteface – in that order. Next power up and connect your scanner via USB to the MacBook. I used the documentation here but here’s the quick version.

Open a terminal window and the following command:

    $ scanimage --list-devices
    device `niash:libusb:002:004-03f0-0405-00-00' is a Hewlett-Packard ScanJet 3400C flatbed scanner

To get a scan from the command line you would need to reference that device name or if you’ve only got one attached just leave it out thus:

    $ scanimmage --format pnm > outfile.pnm

or in full:

    scanimage -d niash:libusb:002:004-03f0-0405-00-00 --format pnm > outfile.pnm

This step should have confirmed whether you are able to communicate with the scanner and get some output. The help file for scanimage will allow you to fine tune the scanning.

    $ scanimage --help
    Usage: scanimage [OPTION]...
    Start image acquisition on a scanner device and write image data to
    standard output.
    Parameters are separated by a blank from single-character options (e.g.
    -d epson) and by a "=" from multi-character options (e.g. --device-name=epson).
    -d, --device-name=DEVICE use a given scanner device (e.g. hp:/dev/scanner)
    --format=pnm|tiff file format of output file
    -i, --icc-profile=PROFILE include this ICC profile into TIFF file
    -L, --list-devices show available scanner devices
    -f, --formatted-device-list=FORMAT similar to -L, but the FORMAT of the output
    can be specified: %d (device name), %v (vendor),
    %m (model), %t (type), %i (index number), and
    %n (newline)
    -b, --batch[=FORMAT] working in batch mode, FORMAT is `out%d.pnm' or
    `out%d.tif' by default depending on --format
    --batch-start=# page number to start naming files with
    --batch-count=# how many pages to scan in batch mode
    --batch-increment=# increase page number in filename by #
    --batch-double increment page number by two, same as
    --batch-prompt ask for pressing a key before scanning a page
    --accept-md5-only only accept authorization requests using md5
    -p, --progress print progress messages
    -n, --dont-scan only set options, don't actually scan
    -T, --test test backend thoroughly
    -h, --help display this help message and exit
    -v, --verbose give even more status messages
    -B, --buffer-size=# change input buffer size (in kB, default 32)
    -V, --version print version information
    Options specific to device `niash:libusb:002:004-03f0-0405-00-00':
    -l 0..220mm (in steps of 1) [0]
    Top-left x position of scan area.
    -t 0..297mm (in steps of 1) [0]
    Top-left y position of scan area.
    -x 0..220mm (in steps of 1) [210]
    Width of scan-area.
    -y 0..297mm (in steps of 1) [290]
    Height of scan-area.
    --resolution 75|150|300|600dpi [150]
    Sets the resolution of the scanned image.
    --gamma-table 0..255,... (in steps of 1)
    Gamma-correction table. In color mode this option equally affects the
    red, green, and blue channels simultaneously (i.e., it is an intensity
    gamma table).
    Scan Mode:
    --mode Color|Gray|Lineart [Color]
    Selects the scan mode (e.g., lineart, monochrome, or color).
    --threshold 0..100% (in steps of 1) [inactive]
    Select minimum-brightness to get a white point
    Type ``scanimage --help -d DEVICE'' to get list of all options for DEVICE.
    List of available devices:

You can specify the area to scan and resolution. Seems you can only output in pnm or TIFF but that’s fine, TIFF is good for most image management software and doesn’t compress. As the documentation says: “The ‘.pnm’ format stands for ‘portable anymap,’ a common image format for graphical files in Linux that can be converted to nearly any other image format with Imagemagick or netpbm.”

UPDATE: Feb 2018, just re-did all this on OS X El Capitan 10.11.6 … and it worked yay!

Played around with scanning options this time … 150, 300 and 600 dpi after reading this article. A scan of two photos to tiff format results in file sizes of 6.4MB, 25.5MB and 101.9MB respectively. The 150 is too pixelated for any kind of cropping or zooming … but there is only a little difference between 300 and 600. If space is not an issue then I’d go with 600.

so …

    scanimage --format tiff --resolution 600 > outfile.tiff

Leave a Reply

Your email address will not be published. Required fields are marked *