Printing through Ruby


(Sabyasachi Mustafi) #1

Some days ago there were some threads about printing through ruby. Here is =
my bad solution. As I expect to make print outs in a easy but feature rich=
ed process as in Visual Basic 6.0 =0AVery frankly speaking that I want to l=
ove Ruby but always I compare it with the fast programming experience in Vi=
sual Basic. I hope it will not take too much time to get a Ruby IDE =0AI ma=
de a simple thing in ruby for printing to the printer.=0AMake the output in=
a file and then print it.=0A=0App=3DFile.open(‘C:\test.doc’,‘w’)=0App.pri=
nt “hello print”=0App.close=0Asystem(‘D:\Program Files\Microsoft Office\Off=
ice10\Winword “C:\test.doc”’)=0A=0AIt works fine in Windows or Linux with t=
he “system”.=0ABut I don’t know if there is any other simple solution. Actu=
ally I need to make a report, so there are some formatted text, also differ=
ent sizes of paper etc. Any other solution for this?=0A=0ARegards,=0ASabyas=
achi Mustafi=0A


(Armin Roehrl) #2

Sabyasachi Mustafi wrote:

Some days ago there were some threads about printing through ruby. Here is =
my bad solution. As I expect to make print outs in a easy but feature rich=
ed process as in Visual Basic 6.0 =0AVery frankly speaking that I want to l=
ove Ruby but always I compare it with the fast programming experience in Vi=
sual Basic. I hope it will not take too much time to get a Ruby IDE =0AI ma=
de a simple thing in ruby for printing to the printer.=0AMake the output in=
a file and then print it.=0A=0App=3DFile.open(‘C:\test.doc’,‘w’)=0App.pri=
nt “hello print”=0App.close=0Asystem(‘D:\Program Files\Microsoft Office\Off=
ice10\Winword “C:\test.doc”’)=0A=0AIt

As long as you stick with Windows (sic), VRuby has an example
printer.rb that you might
want to look at.

good luck, -A


(CRIBBSJ) #3

Sabyasachi Mustafi wrote:

Some days ago there were some threads about printing through ruby. Here is =
my bad solution. As I expect to make print outs in a easy but feature rich=

Check out Rpv (www.rpvreport.com). I use it a lot in my Python and Ruby
gui apps to replace the functionality of a Crystal Reports. It cost me
a one time fee of approx $40 and I get to distribute the Rpv runtime in
my reports royalty-free.

Jamey

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.