[Xprint] XPrint and Gtk2
Drew Parsons
dparsons at debian.org
Thu Oct 27 13:20:40 EDT 2005
On Mon, 2005-07-18 at 17:50 -0300, Christoph Simon wrote:
> Hi,
>
> I was wondering if it is possible to use Xprint from within a gtk2
> program and how I would have to proceed. Would I have to setup a
> secondary X connection (to Xprt) and trick gtk somehow to use it,
> redisplay the widgets with whatever I want to print (maybe disabling
> the window decoration)? Is there some clean way to do it? I know, that
> I can get the X-Display from gtk, so I should be able to find the
> printer list and configuration options, but what about the page
> preview? Is there some simple sample code which I could use for learning?
> I think mozilla uses Xprint, but I would like to avoid having to read
> all of the mozilla code to find out.
>
I haven't written an application to use Xprint so I can't give any
specific advice. I understand the Xprint interface is something like
drawing to screen using the lower level X api. GTK is a higher level
interface that hides these lower level details from you, so programming
in GTK is simpler than programming in raw X.
I presume you've seen the Xprint API docs at
http://xprint.mozdev.org/docs/index.html#manpages_3
There's more gory detail at
http://xprint.mozdev.org/docs/xp_library/xp_library.html
You may find it worth your while to have a look at Cairo. Similarly to
Xprint, it is trying to implement the concept of
what-you-see-is-what-you-print. But it's API is supposed to be
organised at a "higher" level like GTK is. I think it uses Pango for
text handling, just as GTK does.
Drew
More information about the Xprint
mailing list