# Using Ruby to control a scanner on Windows

**URL:** <https://www.ruby-forum.com/t/using-ruby-to-control-a-scanner-on-windows/149972>\
**Category:** Ruby\
**Created:** [October 1, 2008, 9:09pm UTC](https://www.ruby-forum.com/t/using-ruby-to-control-a-scanner-on-windows/149972 "2008-10-01T21:09:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimdeuc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b77776/32.png) [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Post date:** [October 1, 2008, 9:09pm UTC](https://www.ruby-forum.com/t/using-ruby-to-control-a-scanner-on-windows/149972/1 "2008-10-01T21:09:05Z")

</div>

Does anybody know if it is possible to control a flatbed or sheetfed  
scanner from Ruby, on Windows XP? My goal is to be able to place a  
paper on the scanner and then just start a Ruby script that would start  
up the scanner, resize the image (with rmagick), and then save the image  
to a file. I need so guidance on how to control the scanner though.

James

---

<div class="post-metadata">

**Author:** ![jimdeuc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b77776/32.png) [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Post date:** [October 2, 2008, 1:30pm UTC](https://www.ruby-forum.com/t/using-ruby-to-control-a-scanner-on-windows/149972/2 "2008-10-02T13:30:09Z")

</div>

James,

You’d probably need to write a ‘C’ wrapper for this. Or else perhaps use  
some library to send commands via the serial-port (if that is indeed how  
it is connected). (I don’t know if there is a ‘serial-port’ library /  
gem available for Ruby or not)

Cheers

John

James D. wrote:

> Does anybody know if it is possible to control a flatbed or sheetfed  
> scanner from Ruby, on Windows XP? My goal is to be able to place a  
> paper on the scanner and then just start a Ruby script that would start  
> up the scanner, resize the image (with rmagick), and then save the image  
> to a file. I need so guidance on how to control the scanner though.
> 
> James
