Printing in Ruby

I made a simple thing in ruby for printing to the printer.
Make the output in a file and then print it.

pp=File.open(‘C:\test.doc’,‘w’)
pp.print “hello print"
pp.close
system('D:\Program Files\Microsoft Office\Office10\Winword
"C:\test.doc”’)

It works fine in Windows or Linux with the system.
But I don’t know if there is any other simple solution. Actually I
need to make a report, so there are some formatted text, also
different sizes of papers etc. Any other solution for this?

Regards,
Sabyasachi Mustafi

···

Law meets Electronics; Veena Weds Sanjay.
Rediff Matchmaker strikes another interesting match !!
Visit http://rediff.com/matchmaker?1

[clip]

It works fine in Windows or Linux with the system.
But I don’t know if there is any other simple solution. Actually I
need to make a report, so there are some formatted text, also
different sizes of papers etc. Any other solution for this?

I think you’re probably best off doing what the unix crowds have always
done: make postscript. After that, you can post-process with free tools
into PDF files, or you can make it into (non-postscript) printer form
with Ghostscript, or you can print it directly with a postscript
printer.

It’s not super-simple, but for a surprising number of tasks, pretty easy
– and Ruby can abstract away a surprising amount, if you write the code
to do it. Anyone else have classes for dealing with Postscript to
share? Mine are as yet theoretical.

Ari