参考项目下载地址:https://codeload.github.com/sjamesr/jfreesane/zip/master
实现代码
package com.cxbdapp.cadre.jfreesane;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.InetAddress;
import java.util.List;
public class test {
public static void main(String[] args) throws IOException, SaneException {
InetAddress address = InetAddress.getLocalHost();
SaneSession session = SaneSession.withRemoteSane(address);
List<SaneDevice> devices = session.listDevices();
SaneDevice device = devices.get(0);
device.open();
BufferedImage image = device.acquireImage();
}
}