Forum: wxRuby How do you get a file to the printer using wxRuby?

755ce658078632d051cc60c811613066?d=identicon&s=25 Ann Maybury (Guest)
on 2011-05-06 00:35
(Received via mailing list)
Can someone point me to some documentation on how to use the printer
using
ruby 1.9.2 or WxRuby?
2aa32559134aa3d596fb749f8ffccde7?d=identicon&s=25 hendra kusuma (Guest)
on 2011-05-06 04:34
(Received via mailing list)
On Fri, May 6, 2011 at 5:40 AM, Ann Maybury <ann.maybury@gmail.com>
wrote:

> Can someone point me to some documentation on how to use the printer using
> ruby 1.9.2 or WxRuby?
>
>
what os do you use?
if it's linux, simply

system("lpr", filename) or raise "lpr failed"

should do the trick
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2011-05-06 08:40
(Received via mailing list)
On 05/05/11 22:40, Ann Maybury wrote:
> Can someone point me to some documentation on how to use the printer
> using ruby 1.9.2 or WxRuby?
>

For the content (text, images, geometric figures) that is to be printed,
a printer is a DeviceContext (DC) that is drawn to in the same way that
wxRuby draws to screen. Have a look at the drawing classes (wxDC).

For controlling the printer (choosing which one to use, choosing paper &
orientation) there is a set of Printing classes.
http://wxruby.rubyforge.org/doc/#printing

There is an example in the distribution in samples/printing/printing.rb
which shows both these aspects

alex
This topic is locked and can not be replied to.