There are ways for an application to set the scan window size in Ranger
and there are a few scanners that provide "snippet window" capture.
However, these features are almost never used by application
programmers.
I recommend that you do not allow/expect the application
to set the scanning window.
Just capture the entire document.