Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - python cant set duplex, but with VueScan and other applications duplex works #10

Open
shamun opened this issue Apr 5, 2016 · 0 comments

Comments

@shamun
Copy link

shamun commented Apr 5, 2016

Duplex scan is not working and also always getting 1 BMP files. Is this a BUG? how can i make sure the duplex works. I am using Windows 8.1 64-bit Python27.

import twain
from time import *
index = 0;

def next(ss):
  try:
    print ss.GetImageInfo()
    return True
  except:
    return False

def capture(ss):
  global index
  try:
    rv = ss.XferImageNatively() 
    fileName = str(index) + '_image.bmp';
    index = index + 1;
    print rv;
    if rv:
      (handle, count) = rv
      twain.DIBToBMFile(handle, fileName) 
  except:
    print "XferImageNatively"

sm = twain.SourceManager(0)
#ss = sm.OpenSource('WIA-EPSON DS-510 #2')
ss = sm.OpenSource()

try:    
  #ss.SetCapability(twain.CAP_DUPLEXENABLED, twain.TWTY_BOOL, True)
  ss.set_capability(twain.CAP_DUPLEX, twain.TWTY_BOOL, False)
except:
  print "Could not set duplex"

#print "acquire image"
ss.RequestAcquire(0,0)

while next(ss):
  capture(ss)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant