I am building an application with python that needs to be able to connect to a scanner and process the data from the resulting pdf/jpeg/whatever. I have been trying to find a way to connect to the scanner to request a scan, but with no real progress.
I have looked around at all the options I could find, including this answer :
Once that hurdle is surmounted then you can use a WIA-CMD-Scanner app to try to acquire the image to a file using https://github.com/nagimov/wia-cmd-scanner , it is a small 35 KB compiled VB exe.
So in my testing that scanner only returns a full platen scan 21.59 cm x 29.70 cm (it would not respect reducing the scan area with this tool.) NOTE also it only works with the first scanner, as found by Windows (You would need to modify the code for targeting a specific model).
The command that works for me (YMMV)
wia-cmd-scanner.exe /w 0 /h 0 /dpi 300 /color RGB /format PNG /output .\scan.png
Scanning to file .\scan.png (dpi = 300, color mode 'RGB', output format 'PNG')
Scan finished in 27 seconds
There is an example of setting date / using for loop in the readme https://github.com/nagimov/wia-cmd-scanner#scripting-and-automation