TWAIN / WIA实现JAVATWAIN、WIA、JAVA

2023-09-07 23:49:29 作者:风软一江水

我的工作,与扫描仪交互的应用程序(Java小程序)。我明白我需要一个吐温库或WIA库,使其在窗口的工作。但我不知道什么是两个差异?我想使用这个库:

I am working on an application(Java Applet) that interacts with scanner. I understand I need a Twain library or WIA library to make it work in windows. But I am not sure what are the differences of two? I am trying to use this library:

http://thorntonzone.com/manuals/Com$p$pssion/Fax,%20IBM%20MMR/MMSC/mmsc/uk/co/mmscomputing/device/twain/index.html

JAR文件的链接被破坏,所以我从这里得到它。 http://rsbweb.nih.gov/ij/plugins/twain-scan.html

JAR file link is broken so I got it from here. http://rsbweb.nih.gov/ij/plugins/twain-scan.html

和从这里的DLL:http://sourceforge.net/projects/twain-dsm/?source=dlp

但是,它不检测信号源。以下是错误日志:

But, it does not detect the source. Here is the error log:

http://pastebin.com/cB9gL0ip

我是64位的机器上。任何人有任何的成功?

I am on 64bit machine. Anybody had any success?

TWAIN规格过长跟着,我还没有发现WIA实施的任何资源。

TWAIN specification is too long to follow and I haven't found any resources on WIA implementation.

任何帮助/指针/资源是极大的AP preciated。

Any help/pointers/resources is greatly appreciated.

推荐答案

在Java中TWAIN设备控制,所有组件都需要在同一个模式。即JRE,吐温帝斯曼(源管理器),和Twain驱动程序(扫描仪驱动程序)的所有必须是32位或全部64位。不混合。

Use the same bit mode

For twain device control in java, all components need to be in the same mode. i.e. the JRE, Twain DSM (Source Manager), and the Twain driver (Scanner driver) all need to be 32-bit or all 64-bit. No mixing.

64位Windows的默认安装中包含吐温DSM的32位模式。你说你已经下载了64位DSM。这可能是因为在扫描仪的驱动程序是32位,这就是为什么它不能被发现。

The default installation of 64-bit Windows contains the 32-bit mode of Twain DSM. And you say you've downloaded the 64-bit DSM. It's likely that the scanner's driver is 32-bit and that is why it cannot be found.

您有2个选项:

使用64位TWAINDSM.DLL。 确保你的JRE / JDK是64位的。 确保您的扫描仪拥有64位驱动程序。

我的扫描仪没有64位驱动程序可用,但我测试使用的是64位的虚拟扫描仪64位体系结构和它的工作。

My scanner doesn't have a 64-bit driver available, but I tested a 64-bit configuration using a 64-bit "virtual scanner" and it worked.

使用32位TWAINDSM.DLL。 确保你的JRE / JDK是32位的。 使用扫描仪的32位驱动程序(可能是默认值)。

您可以下载32位和64位 TWAIN扫描仪虚拟的位置。

You can download 32 and 64 bit twain virtual scanners here.

注:我提到了JDK,因为如果你从一个IDE它可能会指向不同的JRE到系统默认运行code。真实的故事,发生在我身上。

Note: I mention the JDK because if you're running the code from an IDE it may be pointing to a different JRE to to the system default. True story, happened to me.