Does anyone know how to print the content of a text widget in a
postscript file ? I need to have main layouts of the contents like
character size and eventually fonts and colors. The widget contains some
image too.
Thanks in advance.
Nicolas.
http://mini.net/tcl/canvas
http://mini.net/tcl/printing
- Veronica
Unfortunately the text widget I want to print is not of my own, it has
already been developped and I don't plan to modify the source.
Anyway, thank you for your answer.
Nicolas.
So, is this a plain Tk text widget or some custom thing? If it's a
custom thing, see if there's a command similar to the text widget 'dump'
command. Use it to get the contents of the widget in a parseable format,
then step through the data and recreate it in a hidden canvas. From
there, use the canvas commands to save as postscript.
I've not actually tried this, and it might be a chore to get the canvas
to look exactly like the text widget, but it might be worth a shot.
This is pretty much how I would go about it as well. I havn't actually
tried this either, but it should be doable and it should be of interest
to the community to get some sort of general even if rough solution. I
don't have all that much time at the moment but I would certainly be
willing to pitch in when I have some more time. If you are interested in
going this way, starting a page at the Tcl'ers wiki would be a good way
to do a simple colloborative effort towards this.
- Veronica
If you take a look at <URL: http://wiki.tcl.tk/9007 > you will see an
attempt by one wiki contributor to create a method of serializing a text
widget. It is not a complete solution (he doesn't attempt to deal with
embedded widgets). However, if someone has an itch, it might serve as a
a way to begin scratching...
--
The Tenth Annual Tcl/Tk Conference <URL: http://www.tcl.tk/community/tcl2003 >
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvi...@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >