TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Developing TWAIN driver

Forums › TWAIN Classic › Developing TWAIN driver

  • This topic has 16 replies, 7 voices, and was last updated 1 year, 5 months ago by asukabelly.
Viewing 15 posts - 1 through 15 (of 17 total)
1 2 →
  • Author
    Posts
  • December 29, 2014 at 5:41 pm #22986 Reply
    jdy0803
    Participant
    • Topics - 4
    • Replies - 5
    • Total Posts - 9

    Hello,

    I’m beginner at TWAIN driver.
    Our software interface with digital sensor and acquire image using API function manufacturer provides.
    I want to make TWAIN driver with this API so that any imaging software which support TWAIN interface can acquire image from the sensor.
    Can I get TWAIN driver sample source code?
    Can I develop with C#?
    I need any advice which can be help.

    Thanks in advance.

    December 30, 2014 at 3:40 pm #26226 Reply
    Erin Dempsey
    Participant
    • Topics - 6
    • Replies - 26
    • Total Posts - 32

    Hello:

    Please see information on the self-certification process at:

    https://www.twain.org/scannerdriverdevelopers/self-certification-process.html

    December 30, 2014 at 5:10 pm #26223 Reply
    jdy0803
    Participant
    • Topics - 4
    • Replies - 5
    • Total Posts - 9

    In my case, The Source is the object of development among the Application, The Source Manager and The Source, is it right?
    In the 2-4 State Transition Diagram of the TWAIN Specification 2.2, there are 7 steps like following.
    1 : Pre-Session
    2 : Source Manager Loaded
    3 : Source Manager Opened
    4 : Source Open
    5 : Transfer Ready
    6 : Source Enabled
    7 : Source Open

    I need sample source code regarding 4~7.
    Can you let me know the location I can download it?

    January 2, 2015 at 4:26 pm #26224 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    The TWAIN Working Group maintains open source sample code (BSD license) for both TWAIN applications and TWAIN drivers (data sources) at the following location:
    http://sourceforge.net/projects/twain-samples/

    The sample driver simulates a scanner, generating its own images. You should be able to find the functions where it does this and insert the calls to your device’s API in roughly the same place.

    The TWAIN Specification fully details all of the things that a driver needs to do:
    https://www.twain.org/scannerdriverdevelopers/specification-and-tools.html

    As for writing the driver in C#, that’s unusual, but not impossible to do. The Data Source Manager looks for a C-style entry point named DS_Entry (the definition is in the Spec and the TWAIN.H file). Once you get past that you can use whatever language you want. However, the sample code is written in C++, so you’ll have a fair amount of work moving all of that code to C#.

    You can get a bit of help from this open source project:
    http://sourceforge.net/projects/twainforcsharp/

    This code shows how to write applications for TWAIN using C#, and includes a complete TWAINH.CS file, that matches all of the content of the TWAIN 2.3 TWAIN.H file put out by the TWAIN Working Group. I’m not sure how well it will apply to development work on the driver side, but it’s a start.

    Myself, I would stick with the C++ code, because then bug fixes and new functionality put out by the TWAIN Working Group will be easy to adopt. But that’s just my opinion… 🙂

    January 3, 2015 at 12:33 am #26225 Reply
    jdy0803
    Participant
    • Topics - 4
    • Replies - 5
    • Total Posts - 9

    @MarkM wrote:

    The TWAIN Working Group maintains open source sample code (BSD license) for both TWAIN applications and TWAIN drivers (data sources) at the following location:
    http://sourceforge.net/projects/twain-samples/

    I downloaded twainds.source.2.1.3.zip, unzipped, opened Twain_DS_sample01visual_studioTWAINDS_VS2008.sln and it was converted to Visual Studio 2010(My Visual Studio version is 2010)
    Compiled it but compile error occurs like attached screen capture.
    How could I fix this error?

    August 19, 2015 at 8:57 pm #26227 Reply
    jdy0803
    Participant
    • Topics - 4
    • Replies - 5
    • Total Posts - 9

    I’m trying compiling with Visual Studio2010 but error occurs.
    Can anybody who have tried with Visual Studio 2010 give me any idea about this?

    August 20, 2015 at 2:41 pm #26228 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Can you share the errors you’re seeing?

    August 20, 2015 at 6:54 pm #26229 Reply
    jdy0803
    Participant
    • Topics - 4
    • Replies - 5
    • Total Posts - 9

    Here is the screen capture.
    I tried VS2008 Express as well but the same error occurs at moc_QT* under GeneratedFiles.

    August 26, 2015 at 1:38 pm #26230 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    If you look in the readme.txt file you should find the following instructions…

    [Windows]
    – install QT 4.5.3 SDK for windows
    – Set environment variable QTDIR and/or QTDIR_64 to qt directory (Ex. QTDIR=C:Qt2009.02qt QTDIR_64=C:Qt2009.02_x64qt)
    – QMake is used to generate the makefiles. You can get a copy of this free in any
    QT Open Source distribution. Please see http://www.trolltech.com for more info.
    – copy the TWAIN_logo.png and TWAINDS_Sample[32|64].ds to /Windows/twain_[32|64]/sample2
    directory.
    – Or use the provided Visual Studio project files.

    After you do that the project should build for you…

    August 31, 2015 at 6:25 pm #26231 Reply
    jdy0803
    Participant
    • Topics - 4
    • Replies - 5
    • Total Posts - 9

    Should I install QT 4.5.3 SDK even though I use Visual Studio 2010?
    If I see the instruction,

    – install QT 4.5.3 SDK for windows
    ………
    – Or use the provided Visual Studio project files.

    QT or VS is preference. Isn’t it?

    To make same environment, I installed Visual Studio 2008 and QT 4.5.3 but I have no idea of how to change the environment.
    Can anybody let me know more detailed information?

    December 28, 2015 at 8:17 pm #26232 Reply
    mdragatsis
    Participant
    • Topics - 0
    • Replies - 2
    • Total Posts - 2

    Hello,

    I am having the same issue and confusion. Can anyone give some guidance?

    Thank you,

    Matt

    January 12, 2016 at 9:04 pm #26233 Reply
    mdragatsis
    Participant
    • Topics - 0
    • Replies - 2
    • Total Posts - 2

    I am also having the same issue. Any help for us would be greatly appreciated.

    October 21, 2016 at 8:26 am #26236 Reply
    moomoo
    Participant
    • Topics - 0
    • Replies - 1
    • Total Posts - 1

    Hello:

    Please see information on the self-certification process at

    Gclub

    October 22, 2016 at 9:00 pm #26237 Reply
    SARAFF
    Participant
    • Topics - 0
    • Replies - 3
    • Total Posts - 3

    Try use Saraff.Twain.DS (https://twainds.codeplex.com/).
    Saraff.Twain.DS is the skillful class library which allows you to design drivers (a Data Source) of flatbed scanner, web and digital camera and any other TWAIN device from .NET environment. You can use this library in your programs written in any programming languages compatible with .NET technology (C#, VB.NET).

    April 18, 2019 at 12:40 am #50897 Reply
    Charlie Liu
    • Topics - 98
    • Replies - 191
    • Total Posts - 289

    Dear Sir/ madam,
    We are manufacturer of oral camera and some other related ODM products. From our clients inquiry, our UVC camera shall have to be recognized by their TWAIN system where installed to my client’s PC. Is it possible for us to get any licensed source code at device side or any vailed open source code/ SDK from TWAIN?
    Sincerely, Charlie

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 17 total)
1 2 →
Reply To: Developing TWAIN driver
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • could not open the twain source. Make sure there is a valid source for your sca
  • Changing TWAIN driver defaults
  • Scanner starts transfer when console gets closed (CITRIX)
  • Kodak RFS 3600
  • Didn’t save enough file scan
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.