Command line scanning

The other day I get to work and realize I left a paper at the house that I need to have that morning. I can’t just print out a new one because it’s a document that can’t just be printed (like a check). Scanning it in is out of the question because the scanner we have is on my primary machine – a Linux box – with XSane set up on it for scanning, and Gimp for image editing. My wife is fairly computer literate, but on Windows. So I guess I’m out of luck. Or am I?

I have my wife put the document on my scanner and proceed to Googling. My first stop was XSane which is a graphical interface to the SANE libraries. From their site:

SANE stands for “Scanner Access Now Easy” and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.).

Since XSane is a GUI to SANE, and knowing that Linux just isn’t Linux unless you can do everything from a command line, I peek at the SANE docs. Sure enough, there it is:

scanimage is a command-line interface to control image acquisition devices such as flatbed scanners or cameras. The device is controlled via command-line options. After command-line processing, scanimage normally proceeds to acquire an image. The image data is written to standard output in one of the PNM (portable aNyMaP) formats (PBM for black-and-white images, PGM for grayscale images, and PPM for color images) or in TIFF (black-and-white, grayscale or color). scanimage accesses image acquisition devices through the SANE (Scanner Access Now Easy) interface and can thus support any device for which there exists a SANE backend (try apropos sane- to get a list of available backends).

So I fire up SSH to my box, type in the command and immediately get an IM from my wife saying that my scanner has got a life of its own. After some tweaking with the settings, I was able to get it to scan the full image in. I then just put it on my FTP server and grabbed it normally from there.

Ahh the power of the internet. I would have never in a million years thought that a command-line interface to a scanner would come in handy, but I humbly admin that I was wrong.

Comments on this entry are closed.