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

Scanning Multiple Files

Forums › TWAIN Classic › Scanning Multiple Files

  • This topic has 3 replies, 3 voices, and was last updated 4 years, 9 months ago by MarkM.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • January 21, 2016 at 3:13 pm #23044 Reply
    cahit
    Participant
    • Topics - 2
    • Replies - 0
    • Total Posts - 2

    I have using pytwain which is twain module for python . I want to scan multiple files . So I put lots of documents on the scanner and it scans all of them . But I can’t get this documents in the program . This is the code:
    import twain

    sm = twain.SourceManager(0)
    ss = sm.OpenSource()

    for i in range(3):
    ss.RequestAcquire(0,0)
    rv = ss.XferImageNatively()
    if rv:
    (handle, count) = rv
    twain.DIBToBMFile(handle, ”{i}.bmp’.format(i))
    It gave an error twain.excTWCC_SEQERROR . So how can I do this ?

    February 10, 2016 at 3:30 pm #26350 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    You’ll have to talk to the folks who wrote and/or maintain pytwain. However, after ss.RequestAcquire() you may only have entered state 5 in the driver. The driver doesn’t go to state 6 until it’s ready to transfer images (indicated by sending MSG_XFERREADY to the application).

    While I don’t normally recommend this. One hack would be to loop on rv = ss.XferImageNatively(), as long as you’re getting twain.excTWCC_SEQERROR. That error indicates that you’re still in state 5. When the driver transitions to state 6 you’ll get back some other status, such as TWRC_XFERDONE or TWRC_CANCEL. You’ll need to check for a few different possible returns.

    April 8, 2016 at 6:56 am #26351 Reply
    susanPr
    Participant
    • Topics - 0
    • Replies - 1
    • Total Posts - 1

    Scanning Multiple Files is very difficult for me

    April 8, 2016 at 9:28 am #26352 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Can you be more specific?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Scanning Multiple Files
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

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • 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.