'system' and printing in Windows

Dear all,

I’d like to give the user the possibility to print some Ruby-generated
results of
my programs (this can be PDF, PS, EPS, PNG files, a .doc document, …)
from
a GUI
program developed in Ruby.
So far, I have created a button, which when pressed, should execute
some
‘system’ command to print the document.
This works, except for that I don’t know what to write in this line
except
for the
system command, when the OS is Windows XP :frowning:
Ideally, I’d like the ‘system’ command to open some option window
of the printer software, where further settings (A4, letter paper,
portrait,landscape etc…)
can be made.

Thank you for your help!

Best regards,

Axel

On 10/2/06, [email protected] [email protected] wrote:

Dear all,
I’d like to give the user the possibility to print some Ruby-generated
results of
my programs (this can be PDF, PS, EPS, PNG files, a .doc document, …) from
a GUI
program developed in Ruby.

This can be a little complicated, and might involve all sorts of nutty
winapi calls.

See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/32861
for an example of printing plain-text documents.

If you’re using more complicated filetypes you may want to consider
using windows’ shellexecute function to just run the associated
program’s ‘print’ action.

This has an example of that approach:
http://rubyforge.org/pipermail/fxruby-users/2005-February/000199.html

Sam

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs