Print problem with Mac OS X cutting pages


I am using the wxruby printing framework to print cash receipts with a
thermo-printer, which can naturally produce very long pages if a lot of
articles are printed on them.

Under Windows XP there are no problems, but under Mac OS X text is not
printed if it’s below a certain line on the printed page (i.e. the “top”
parameter is too large).

I have found out, however, that when I calculate the size of it, it is
exactly where a A4 page would end (just with different scaling), i.e.
about 150% of the width of the page.

I have already tried several other page formats, e.g. letter format
the longer side there is more than 150% of the shorter side), but

Has anyone else experienced this problem? Can this be fixed from within

Please fix it! This feature is really important to me!

Thanks a lot,


Arno Dirlam wrote:

after about 150% of the width of the page.
I’m not very familiar with the printing framework, so it would help to
see a short excerpt of the most relevant pieces of code just to know
what classes you’re using.

More generally if there is a way to solve this (I expect there is) it
will be general to wxWidgets and wxPython. So you might want to try
searching for help but using the classnames with wx prefix (eg
wxPrintout). I’ve often found answers to obscure questions via wxPython,
simply because that framework has been around a lot longer. Also if it’s
a bug, it will have to be fixed in wxWidgets and won’t be fixable in
wxRuby alone.



the code basically looks like this (whereas the &block variable tells
MyPrintout what to print):

print_data =

print_dialog_data =
print_dialog_data.set_all_pages true
print_dialog_data.set_to_page 1

printer =

parent =, -1, “wxRuby Printing”,, 0),, 400))

print_data.set_printer_name(new_printer_name) # set printer
printer =
printout = || “My printout”,
print_data, options, &block)

print it

if (!printer.print(parent, printout, false))
if (Wx::Printer.get_last_error == Wx::PRINTER_ERROR)
raise ArgumentError, “There was a problem printing.\nPerhaps your
current printer is not set correctly?”
raise ArgumentError, “You canceled printing”

Most of it is taken from the Printing example shipped with wxRuby. It is
modified, however, to work without user interaction.

What is your guess?

Thanks and best regards,

I believe in this case, wxRuby is using the Default Font provided by the
either that be Windows, or Mac OS X. I do believe there needs to be
calculation to set the constraints with reference to the Font used, so
may need to do some Device Caps calculations on Fonts, against a DC
from the Printer. Don’t ask me how to go about that, as I’ve never
with the wxRuby printer framework, in any way shape or form, just
remembering some things from Device Caps and DC drawing / printing on
various other platforms.

Mario S.