让 Java 和 TWAIN 很好地协同工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 10:44:42  来源:igfitidea点击:

Getting Java and TWAIN to play together nicely

javajava-native-interfacetwainimage-scanner

提问by jacobko

I'm working on building an app to scan directly from TWAIN scanner to a Java applet. I'm already aware of Morenaand JTwain, but they cost money. I need free. I could re-invent the wheel with JNI, but it seems like someone has probably already done this as a FOSS tool.

我正在构建一个应用程序以直接从 TWAIN 扫描仪扫描到 Java 小程序。我已经知道MorenaJTwain,但他们花钱。我需要免费。我可以用 JNI 重新发明轮子,但似乎有人可能已经将其作为 FOSS 工具完成了。

Is anyone familiar with a freetool that can get a Java applet to read directly from a TWAIN scanner?

有没有人熟悉可以让 Java 小程序直接从 TWAIN 扫描仪读取的免费工具?

回答by Spike0xff

Calling the TWAIN API from anything except C/C++ is going to be a major pain, it relies entirely on complicated C structures that you have to replicate exactly in memory. If you need only fairly basic scanning, you could use something like GitHub siteto call my old free 'EZTwain Classic' DLL (google for eztw32.dll)

从 C/C++ 之外的任何东西调用 TWAIN API 将是一个主要的痛苦,它完全依赖于复杂的 C 结构,您必须在内存中精确复制。如果你只需要相当基本的扫描,你可以使用类似GitHub 站点的东西来调用我旧的免费“EZTwain Classic”DLL(谷歌搜索 eztw32.dll)

回答by mauriciopastrana

hm. I might have some homebrew available for it somewhere I could check, but for now: At our company, we basically gave up on this issue and implemented an (unfortunately win only) ActiveX solution: Site Link

嗯。我可能在某个可以检查的地方有一些可用的自制软件,但现在:在我们公司,我们基本上放弃了这个问题并实施了一个(不幸的是仅获胜)ActiveX 解决方案:站点链接

回答by RkaneKnight

I've actually purchased the chestysoft activeX control. Been using it for about 3 years. Works great but as with all ActiveX you are restricted to IE. And this one is 32-bit only. I'm looking into a flash approach now. Since flash can capture from a camera why not from a scanner. If I remember I'll report back what I find.

我实际上已经购买了chestysoft activeX 控件。已经使用它大约 3 年了。效果很好,但与所有 ActiveX 一样,您只能使用 IE。而这个只有 32 位。我现在正在研究一种闪存方法。既然闪光灯可以从相机捕捉,为什么不能从扫描仪捕捉。如果我记得,我会报告我的发现。