This open source software project connects the world of java with SANE.SANE is an application programming interface standard used to access scanners & digital cameras ... .This project consists of a SANE frontend written in java.

jsane

This is the java wrapper to the SANE functions. I tried to keep the API as far as possible the way the SANE team designed it. But due to the way java works some things had to be changed.

  1. An unexpected status code in jsane.c will throw a SaneIOException.
  2. The read operation is designed to act like a java.io.InputStream read.

SaneScanner, SaneDevice

These classes add the GUI bits: a select dialog and an acquire dialog. They turn the image data into a BufferedImage object, if they can handle the data. Then they signal this event to the ScannerListener objects. Effectivly this is constituting a SANE frontend.

I haven't implemented some of the GUI-bits for some Option Descriptors. But I have tested the Frontend with the SANE test scanner and everything seems to work. In any case you should get all the data SANE supplies for this descriptor in a description panel.

SaneExample

You can find a simple application here:SaneExample.java.

And uk.co.mmscomputing.device.sane.jar here, which bundles all the necessary class files. In this scenario the jar file and the SaneExample.java file are in the same folder.

  • Compile:
    javac -classpath .:uk.co.mmscomputing.device.sane.jar SaneExample.java
  • Run:
    java -classpath .:uk.co.mmscomputing.device.sane.jar SaneExample


[1] SANE : www.sane-project.org [last accessed : 2003-11-18]
[2] Sheng Liang (1999), The Java Native Interface, SUN, Palo Alto

sub-directories:
  1. uk.co.mmscomputing.device.sane.applet:
    A very simple java scan applet for jsane.
  2. uk.co.mmscomputing.device.sane.gui:
    The GUI bits for the SANE frontend.
  3. uk.co.mmscomputing.device.sane.lin32:
    libjsane.so : The jsane cpp library for linux.
  4. uk.co.mmscomputing.device.sane.option:
    Option Descriptor classes for the jsane project.
Projects :
  1. uk.co.mmscomputing.application.imageviewer:
    A simple Multi Page Image Viewer Applet. To view multipage *.sff, *.tiff and *.gif files. Twain and SANE test application.
  2. uk.co.mmscomputing.device.scanner:
    Package scanner provides abstract parent classes to the classes in the twain and sane packages.
  3. uk.co.mmscomputing.util:
    A few useful utility classes