[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Printing in Ruby

Sabyasachi Mustafi

9/4/2003 1:09:00 PM

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/ma...


3 Answers

Aria Stewart

9/4/2003 4:23:00 PM

0

[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

Simon Strandgaard

9/4/2003 10:44:00 PM

0

On Thu, 04 Sep 2003 23:08:57 +0900, Sabyasachi Mustafi wrote:

> 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?

DocBook-xml is a nice open-standard format. It can output a huge range
of formats (html, pdf, ps, man, rtf, xhtml, winhelp, others?).
There is also many free tools for processing docbook.

<section><title>Hello World</title>
<para>This is DocBook-xml.</para>
</section>

Quite nice, I love it.

--
Simon Strandgaard

Bloodstar

9/10/2009 6:41:00 PM

0

> Personally I have had some differing experiences.
>
> In the past, a demo for me more often than not resulted in a no-buy
> decision whereas I would often buy a game on a try-out/impulse basis
> (and often regretted it).
>
> When the recession came my default decision became no-buy but a good
> demo would tip me over the edge into a purchase, e.g. WPP.
>
> In these harder times, if you are confident you have a winner, putting
> out a demo is probably a really good idea.

And they are confident they don't have a winner so that's why no demo :)))

I think that that should be universal. Ie in 95% cases to have demos for all
games so gamers can choose.

Even PS3 have demos :)