Skip to content

TWAIN library using ctypes bindings

License

Notifications You must be signed in to change notification settings

Suyashd999/pytwain

 
 

Repository files navigation

pytwain

This is a native Python library for TWAIN API.

To install this library run:

pip install pytwain

Once installed you can run following sample Python script to scan one image:

import twain
import tkinter
import logging

logging.basicConfig(level=logging.DEBUG)
root = tkinter.Tk()
root.title('scan.py')
sm = twain.SourceManager(root)
src = sm.open_source()
src.request_acquire(show_ui=False, modal_ui=False)
(handle, remaining_count) = src.xfer_image_natively()
twain.dib_to_bm_file(handle, 'testscan.bmp')

Full documentation for the library located here.

References

About

TWAIN library using ctypes bindings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%