Access and control cameras and scanners from Java on Windows

JTwain FAQs

  1. JTwain is the Java counterpart of TWAIN. It is 100% TWAIN 1.9 (the latest specification) compatible.
    It is a TWAIN suite developed by LAB Asprise!. It is 100% TWAIN (most updated version 1.9) compatible. JTwain enables Java developers to acquire images from scanners and digital cameras easily. Its universal APIs bridge Java and scanners, digital cameras tightly. With more than five years extensive development, LAB Asprise! proudly presents you the long waiting version 9.0 of JTwain.
  2. JTwain supports almost any kinds of scanners and other devices.
    Most of digital cameras and scanners are TWAIN compatible - With JTwain, you can use Java to access, control almost any kinds of digital cameras and scanners!
  3. Is there any difference between the trial version and full version?
    There is no difference. However, according to the evaluation license agreement, developers are not allowed to distribute software using a trial version of JTwain.
  4. Will JTwain support Solaris, Linux, Mac?
    JTwain supports all kinds of Windows platforms. Linux release is planed. We measure the priority of porting JTwain to an OS by its market share.
  5. High performance: My scanner supports ADF, is JTwain capable of ADF?
    Yes. Please read Developers' Guide, Section 'Automatic Document Feeding'
  6. If I develop an application using JTwain, how can I package and distribute it?
    With JTwain, application packaging and distribution are made very easy. Developers only have to include two files: JTwain.jar and AspriseJTwain.dll. The first one has to be put in the CLASSPATH, and second one could be put into PATH or anywhere. Read Developers' Guide for more details.
  7. What version of Java is required for JTwain?
    Java version 1.2 or above.
  8. Can I use JTwain in my Applet/Application/Web Application?
    Yes. JTwain can be used in Java applets, java applications, web applications, etc. Our support team assists licensees to deploy JTwain if necessary.
  9. What's the different between acquiring images from a digital camera and a scanner?
    From the developer's point view, there is no difference. The same set of APIs can be called to perform image acquisition from digital cameras and scanners. Unified API by JTwain.
  10. The demo applet is exactly what i want, so what license should i purchase?
    You can choose for the following two bundles: (a) JTwain Single Developer License + JTwain Web Applet License [Including binary and source code for the applet so that you can customize it]; or (b) The Site License, which includes everything - the binary and source code for the JTwain library and the web applet.
  11. Is it possible to save scanned images into TIFF files?
    Yes. You can use our Asprise Java TIFF Library to save images into TIFF files.
  12. How can i convert an acquired image into a BufferedImage?
    With JTwain v9, you simply use source.acquireImageAsBufferedImage method.

    If you are using an earlier version of JTwain: Sample code: [Java 1.4+]
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import com.asprise.util.jtwain.*;
    try {
        Source source = SourceManager.instance().getDefaultSource(); // Acquire image from default source
        Image image = source.acquireImage(); // Acquire the image
        // Loads the image completely ...
        // Click here to find how to load images completely with MediaTracker.
        // ...
        int imageWidth = image.getWidth(this);
        int imageHeight = image.getHeight(this);
        BufferedImage bufferedImage = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = bufferedImage.createGraphics();
        g2.drawImage(image, 0, 0, this);
        // Now, you can use the bufferedImage object ...
    }catch(Exception e) {