Thanks Michael,

not exactly what I was looking for.
I am investigating how difficult is to write my own ps exporter,
based on the Canvas postscript source code.

Vasilis


________________________________________
From: Tkinter-discuss 
[tkinter-discuss-bounces+vasilis.vlachoudis=cern...@python.org] on behalf of 
Michael Lange [klappn...@web.de]
Sent: Tuesday, June 18, 2019 11:16
To: tkinter-discuss@python.org
Subject: Re: [Tkinter-discuss] Text to postscript

Hi,

On Mon, 17 Jun 2019 12:16:49 +0000
Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote:

> Hi all,
>
> Canvas has this nice method to convert it to postscript, which is
> perfect for printing. Is there something similar for Text(), I could
> not find anything internal but if there is something external to
> convert to html, ps, pdf it would be nice.

maybe you could use tkimg to create a "screenshot" of the widget in
postscript format.
To enable tkimg's "window" handler once it's installed you just need to do
something like

    root.tk.call('package', 'require', 'img::window')

early in your code.

IIRC by default tkimg's "window" handler will include only the visible
part of the widget, but here:

https://wiki.tcl-lang.org/page/Img

George Petasis posted a recipe that seems to be able to capture the whole
contents of a canvas widget. I don't know how well this actually works
though and if it can be done with a Text widget in the same fashion.


Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

History tends to exaggerate.
                -- Col. Green, "The Savage Curtain", stardate 5906.4
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to