GTK Printing on Win32
April 5, 2008 2:57 pm GeneralNow that things have settled down a little at work, we’re finally in the process of moving to gtk# 2.10 now. One of the cooler things that we can finally use now is the Gtk printing system. Previously we were using Gnome.Print on Linux and System.Windows.Forms.PrintDialog on Windows, which sucked for various reasons that you can probably guess. Obviously what we really needed was something we could use easily from both Linux and Windows.
Gtk.Print to the rescue! Except that it didn’t work on Windows yet. But in Berlin Behdad pointed me to #488833, to add support for cairo_win32_printing_surface to GTK. So once I got home I finished up the patch and it’s now committed to gtk+ svn trunk. Since it requires a new (and unstable) version of Cairo I can’t commit this support to gtk-2-12 branch, so I think I’m going to have to maintain a branch for Medsphere’s use.
This doesn’t solve print preview, though, so that’s the next thing I want to work on.
April 5th, 2008 at 6:20 pm
You may want to take a look at gedit-print-preview, it’s a generic standalone print preview widget, though it may be slow for non-textual contents since it renders stuff on the fly.