27

I want to scan a number of papers through Java. I found the mm's computing twain library.

When I run the example TwainExample.java at the site, I receive this error.

uk.co.mmscomputing.device.twain.TwainIOException: Cannot load Twain Source Manager.

On the other hand, almost the same code works with ImageJ as a plugin. Yet, when I used this code by itself I still receive the same exception.

I wonder why this is not working.

RAS
  • 7,807
  • 15
  • 61
  • 81
Any Thing
  • 314
  • 3
  • 5
  • I've downloaded source code of ImageJ. I run the program through Eclipse. It worked well. Then, I run the Twain Scan Plugin, again I received the same errors. So, the same program (apparently not same) and its plugin works from the compiled versions. However, when I compile it from the source code, it doesn't. – Any Thing Jan 01 '13 at 22:59
  • Can it be about permissions? – Any Thing Jan 01 '13 at 23:05
  • I know this is quite old, have you had success with it? I have the same problem. the plugin shows the dialog to select the scanner but TwainExample.java won't. For me it does find SM but does not find any sources. I'd appreciate any pointer. – Mo3z Apr 09 '13 at 14:41
  • As far as I remember, before I asked the question I had tested the code in 32-bit Java but it hadn't worked. Later, I used 32-bit Eclipse and 32-bit Java, it worked. What system are you using? – Any Thing Apr 09 '13 at 18:57
  • I am on 64bit system. In the native C++ code, it mentions I should have Windows/twain_64 library?or directory, which I don't have on my system. – Mo3z Apr 09 '13 at 20:24
  • I had 64bit system too, but I used 32bit Eclipse & Java. I have no knowledge how to use this library on C++. – Any Thing Apr 09 '13 at 21:15
  • 2
    AnyThing, I answered @Moiz's question. Hopefully it will help him. It may help you too: http://stackoverflow.com/a/15993050/1322435 – Jonathan Spiller Apr 13 '13 at 21:19

2 Answers2

2

You can try download TWAINDSM.DLL for 64bit and put it in C:/windows/system32, or 32 if you have it. Find it on SourceForge

Regards

1

In the past I've used Morena library successfully. It is commercial, however there is a Personal non-commercial license if that does the job for you. Even worked from a signed applet.