Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
5 Posts
Printer list

Hello

How can I obtain the list of printers available on the server machine, in my rails application?

Thanks!

regards

This is a very broad question and the solutions vary depending on your server platforms and configurations. You may want to specify your specific configuration of the server.

Hello Thanks for your answer. My server is on a Windows 2000 environment. Regards.

Then you'll likely have to use the Win32API for that. I have yet to use Ruby's Win32API library but hopefully this will get you going in the right direction. I used to work with the Win32 API way back with VB/.NET but it's been a while. If I stumble across any old notes I'll update this thread, but no promises. Good luck.

Well, no time to dig any further but here's something to get you started in your search:

printers = Win32API.new('winspool.drv', 'EnumPrinters', [params], 'P')

So it's the EnumPrinters function from the Win32 API Winspool library. Hopefully once you view some docs online you'll be able to make more sense of it. http://techref.massmind.org/techref/os/win/api/win32/func/src/f21_4.htm

5 Posts
Login to add your message