I recently searched for ways printing plain (but formatted) text
and without major requirements using ruby and stumbled upon wxruby,
seems to be a nice framework that would meet my requirements quite well.
However, since I use a local Ruby on Rails server, I would like to be
to select a printer as well as print the text without using dialogues,
only using the wxruby classes to interact with the user via http
I had a look at the “printing.rb” example in the wxruby directory and
modified it to just print formatted text, as I want it, but it’s still
having dialogues. My try without dialogues was the following
dc = Wx::PrinterDC.new("", “”, “”) // deprecated way to initiate
on default printer
dc.set_font(Wx::Font.new(12, Wx::DEFAULT, Wx::NORMAL, Wx::NORMAL, false,
dc.draw_text( “D”, 0, 0)
Since I could not figure out the whole concept of class relations in
yet, I would be very glad if someone could help me and give examples for
selecting a printer and printing in wxruby without the use of dialogues.
As far as I understand, I need to create a PrintData object. This
object could be handed to the device context PrinterDC containing my
formatted text that got into there using draw_text methods. I don’t yet
understand where this PrintData comes from, if not from a dialogue
Thanks a lot for any hints!