Modern scanners have several features and provide APIs. Unfortunately, the APIs do not have a standard protocol because each manufacturer defines its own standard. To develop something like you want is gambiarra and even if you can, it can not last long. It may not even be used. A "big" and complex investment for something that may not be useful or return the investment due to the tendency that in the short or medium term the devices will be able to provide a univerval standard in their APIs.
However, this is personal opinion. To better understand, search for TWAIN-compliant devices: link
TWAIN is a NPO (Non profit organization), ie a non-profit organization. This is a strong attraction and motivates global acceptance.
If you really want to develop such a solution, the path is there because many manufacturers have already adopted it. But do not be fooled because the market changes overnight. It may happen that "tomorrow" will emerge a pattern that may be better accepted than TWAIN.
If you wait for an answer where you can copy and paste ready-made codes and see everything working without any effort, forget it. It is not a trivial task, and anyone who has already developed solutions will not provide it for free, even more in forums and question and answer sites.