14

I need to add TWAIN scanning to an Delphi application and am having trouble locating an off-the-shelf component to do so.

I downloaded TDelphiTwain but, when used in D2010 on Windows Vista, it does not appear to recognize any Twain sources on my system. I also tried the trial version of Twain Toolkit for Delphi from MCM which has the advantage of being currently updated (DelphiTwain's last update was 2004), but the Twain Toolkit will not even compile on my system (I think some of the DCUs are out of date).

Can anyone suggest a simple method of getting TWAIN scanning into my Delphi application?

UPDATE: Using vcldeveloper's update to DelphiTwain (see below) I was able to get this working. Also, I also discovered that Envision Image Library supports Twain scanning as well as assisting in handling multi-page TIFFs, and has been updated for compatibility with D2010.

Late Breaking UPDATE VCLDeveloper's code, below, works fine. However, I settled on Envision library which includes the ability to easily create multi-page TIFF files. I got the Envision scanning, including multi-page file handling, implemented in a few hours.

4
  • I would have mentioned the MCM one you've already looked at - I used it very recently with D2007 and it worked a charm (especially given that it's not particularly expensive). Have you dropped them an email about your compilation problem?
    – robsoft
    Jan 13, 2010 at 19:30
  • I haven't contacted them, but now that I have a recommendation, I'll give it a go. Thanks for the info. Jan 13, 2010 at 19:48
  • Hmm, that is unfortunate. We currently use TDelphiTwain with Delphi 6 and XP. Looking at upgrading to D2010 in the near future, so interested to learn more.
    – Scott W
    Jan 13, 2010 at 19:51
  • Scott: See vcldeveloper's answer below. I'm downloading now. Jan 13, 2010 at 19:53

2 Answers 2

20

I changed DelphiTWAIN to work with Delphi 2009 and 2010. You can download the source code from here: http://www.kluug.net/delphitwain.php

Additional links are here: http://torry.net/pages.php?id=507
and here: http://www.delphipraxis.net/1179589-post3.html

4
  • Outstanding. I can't thank you enough. I used your updates to compile the DelphiTwain demo, and it works fine. Jan 13, 2010 at 20:02
  • 6
    vcldeveloper's homepage is unfortunately down so I reuploaded Delphi Twain on my homepage: kluug.net/delphitwain.php
    – oxo
    Nov 1, 2012 at 11:39
  • Using Delphi, how can i send the commands to FOCUS, ZOOM in/out? i have EPSON ELPDC21?
    – user285594
    Apr 4, 2016 at 5:23
  • This works quite well. However, there is an issue with the library when there are more than 10 scanners installed (who has 11 scanners installed?), easy enough to fix (TPointerList.SetAllocated). I'm told it has been updated on kluug.net (even though the version and date haven't changed).
    – tmjac2
    Dec 18, 2020 at 20:55
1

Another graphic library that also supports TWAIN scanning is ImageEn which also can save the scanned documents as PDF (as well as numerous graphical formats). That feature alone sold me on that product years ago.

2
  • 1
    Thanks. Looks similar to Envision. I believe Envision can also scan and save as PDF. Feb 9, 2010 at 14:34
  • 1
    It's super expensive if you need it only for scanning: imageen.com/order/index.html
    – Steve
    Aug 14, 2014 at 15:36

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.