gdk print support



Hi.

I uploaded to ftp://ftp.pluto.linux.it/pub/developers/gdkprint.tar.gz
a gdk interface to the X Print Extension (I tried on ftp.gimp.org,
but it was slow and closed the connection at some point...).

Here is the README...

This code is LGPL.

This is a gdk interface to the X Print Extension.
This lets you use the existing gdk_draw_* calls to draw on
a GdkWindow, and the server takes care to send the output
to the printer.

You need a X Server with the XpExtension extension (the Xprt
that comes with XFree86 works fine, I don't know if the
commercial servers provide the print extension...)
and the libXp library.

You can't use this stuff in a gtk program yet if you use a
different server for printing: gtk (and gdk) needs to be changed 
to allow multiple connectios to X servers (any takers?).

Look in the header file and in the test program for usage
information: it's mostly straightforward.

There is something missing:
	get/set printer attributes.
	start/end doc/page notify events.
	GDK_PRINT_GET_DATA mode (this will allow print to a file...)
	GDK_PRINT_RAW.

Once I get your comments and once the missing functionalities
are there I will make a patch against gtk+.

NOTES:

Use with Xprt.

Start the Xprt server on a free display (usually :0.0 is the
"video" display), so use something like this:

	Xprt :1.0 &

Start the test program:

	./ptest --display :1.0 postscript_printer_name

You should get two pages of output: it seems it's with a black
default background so better you don't' print these examples!.
Please note that if you don't have the lp program, you should
put something like this in /usr/bin/lp (or get some docs on how
to configure the Xprt server:-):

-- cut cut --
#!/bin/bash
# /usr/bin/lp -d %printer-name% -n %copy-count% -t %job-name% %options%

# Uncomment one of the exec lines: this may be run as root, beware!
# exec cat >/tmp/$RANDOM.ps
# exec lpr -P $2
-- cut cut --

Hvae fun,
	lupus



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]