Take the 2-minute tour ×

I saw a similar one already asked in Printing python tkinter output, but it was a couple years ago, and it related to the print of a tkinter canvas.

I need instead to print the content of a text widget, which may contain also images. I was surprised/horrified to discover that maybe there isnt a way to do it - please tell me that in these two years a way has been found!

P.S. I could live with a PDF export, just in case...

adding some info: PDFlib seemed to have many drawbacks, but it can be (maybe) tackled:

1) price: it is high .... then I noticed http://www.pdflib.com/download/pdflib-family/pdflib-lite-7/ : the lite version seems to have all I need, I guess

2) difficult install, with a configure&make step that didnt want to setup the python bindings... then I found out that a simple yum install pdflib-lite-python was enough (if you live on Linux)

anyway, install the source, because they contain many python examples...

I'll add further info if I can make it work!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The is no support in the text widget for printing, or exporting to a print-friendly format.

That being said, if you don't have embedded widgets or images then it should be pretty easy to take the contents of a text widget and convert it to pdf using something like pdflib. While the text widget doesn't directly support rich text formats, it has very good introspection capabilities.

share|improve this answer
thanks Bryan. I gave a look to pdflib... seems a bit of a complex and overweight solution, I hope I'll be able to code with it –  alessandro May 30 '12 at 13:19
add comment

Your Answer


