Pradeep B schrieb:

On Sat, May 29, 2010 at 7:33 PM, Kevin Walzer <k...@codebykevin.com> wrote:

Tkinter doesn't wrap native printing API's. There are a few extensions that
do it, but they are platform specific and not complete.

The usual ways of printing are like this:

1. If you're outputting data from the text widget, write that to a temporary
text file and print via lpr.

2. If you're outputting data from the canvas, write that to a temporary
postscript file and print via lpr.

This is on Unix/MacOS. Not sure what the equivalent API on Windows is.

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list



Thanx Kevin.

Anybody can throw light on how to do the same in Windows ?

-pradeep


The conventional --crude-- way is to take the bitmap of a
window and to stretchDIBBitBlt it onto the printer device in windows
and osx. Native printer dialogs do exist for both platforms ...

When you do not need a printer dialog:
Convert the Tk-GUI to SVG, then wrap it into a fo-xml wrapper
--fo accepts inline SVG-- and use fop for printing.
This approach works cross-platform, albeit you need a Java
intallation (fop is a Java application).

You can use http://jeszra.sourceforge.net to generate SVG for a complete Tk-GUI.
In addition. there is a python/tkinter SVG export project for the Tk canvas
--search the tkinter wiki.


-roger

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to