PriNet has asked for the wisdom of the Perl Monks concerning the following question:

I finally reached a point where I need to scan a document via perl & perl tk and I am really getting stumped. I have (of course) tried using 'Win32:API & Win32::Scanner::EZTWAIN' as prescribed by most internet searches. The modules load correctly, but when I try to implement the
$Scanner = new Win32::Scanner::EZTWAIN(-dll=>$Current_Directory.'/EZTW32.dll');
directive, I get 'Tk::Error: Importing API call TWAIN_SelectImageSource failed (at that line)' and can't figure out why. I have loaded EZTW32.dll (testing on windows XP) and cannot figure out what is wrong... Anyone have any ideas, or, even, another way to scan a document page on a scanner that is installed properly and works with paint shop? ANY direction at this point would help, I'm still scouring the net for alternatives.

Has anyone seen this sliced bread thing? I's better than... sliced... well... never mind...

Replies are listed 'Best First'.
Re: TWAIN Scanner
by roboticus (Chancellor) on Mar 25, 2018 at 02:57 UTC

    PriNet:

    I've not used Win32::Scanner::EZTWAIN before, but looking at the documentation regarding the -dll parameter to new, it says you can "use this option to tell where eztw32.dll is located, use a trailing slash." Based on that, I'd guess that you just need to tell it the directory containing eztw32.dll, not the entire pathname of the file. In other words, have you tried changing it to:

    $Scanner = new Win32::Scanner::EZTWAIN(-dll=>$Current_Directory . '/') +;

    Hopefully, that'll do it for you.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.