No subject


Thu Feb 18 01:58:27 EST 2010


"The PDF in comment 2 is about 8 times smaller than it should be. One possible cause of this bug is if gtk_print_operation_set_unit (op, GTK_UNIT_POINTS) is not called. gtkprint defaults to GTK_UNIT_PIXEL - a useless unit to be using with printers.

On Linux GTK_UNIT_PIXEL units are 1 unit = 1/72 inch (the same as GTK_UNIT_POINTS as well as PostScript and PDF units). On Windows GTK_UNIT_PIXEL units are the GDI device units which for printers is the dpi resolution. So for a 600dpi printer 1 unit is 1/600".

If the application was developed on Linux and assumes the default gtkprint units are always 1/72" inch the output on Windows using a 600dpi printer will be 72/600 = 0.12 of the size (or approximately 1/8 of the size)."

Solution was to use webkit_web_frame_print_full() which allows us to provide our own GtkPrintOperation object with units set to GTK_UNIT_POINTS.  Tested on both Linux and Windows.




More information about the gnucash-patches mailing list