JAVA 的 TWAIN/WIA 实现 [英] TWAIN/WIA implementation for JAVA

查看:31
本文介绍了JAVA 的 TWAIN/WIA 实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个与扫描仪交互的应用程序(Java Applet).我知道我需要一个 Twain 库或 WIA 库才能使其在 Windows 中工作.但我不确定两者有什么区别?我正在尝试使用这个库:

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/Compression/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.

非常感谢任何帮助/指针/资源.

Any help/pointers/resources is greatly appreciated.

推荐答案

使用相同的位模式

对于java中的twain设备控制,所有组件都需要处于相同的模式.即JRE、Twain DSM(源管理器)和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 的默认安装包含 Twain 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.

您有两个选择:

  • 使用 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.真实的故事,发生在我身上.

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.

这篇关于JAVA 的 TWAIN/WIA 实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆