Hi,

thanks for the feedback!

On Fri, 2 Jul 2021 09:17:41 -0300
Emiliano Gavilan <emilianogavi...@gmail.com> wrote:

> You can achieve what you want with the correct set of options to the
> canvas postscript() method, documented here:
>
> https://www.tcl.tk/man/tcl8.6/TkCmd/canvas.html#M61

yes, I have been looking at that man page the other day for what felt
like an hour, but failed to get the point :-)
Well, maybe at least I can partially blame that failure on the man page
authors, since there is nothing mentioned that the default values are
apparently pagex=306.0, pagey=396.0 which appears to be half the size of a
page in U.S. letter format measured in printer points. This sort of
information might have helped :-)

>
> In your case:
>
> canvas.postscript(pagex=0, pagey=0, pagewidth=594, pageheight=841,
> pageanchor="sw", file="test.eps")
>
> This will scale the output to fit into an A4 page. The final result
> will depend also of the area of the canvas
> being exported, controlled by the x, y, width and height options (the
> default is to export the visible part).
> A bit of experimentation will get you the correct values of these
> options.

No, maybe I did not describe what I want to achieve accurately; I do not
want the output to be scaled, but to be printed in the exact requested
millimeter-size.
I got it now though that this can be achieved by setting the pagex
and pagey values accordingly; I gather that for an A4 page this should be
approx. pagex=298, pagey=421 with pageanchor='center'. For some reason
here this is still a little bit off, but maybe this can be blamed on the
worn mechanics of my cheap old printer. Or maybe the printer has some
sort of hard-wired margin on each side that it cannot print on and that
ought to be taken into account (if the users only knew about it).

Anyway, I wasted some paper and found that for this particular printer
values of pagex=290.2 and pagey=419.5 seem to be as close to perfect as
it gets with that sort of hardware.

Thanks again, and have a nice day :)

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

Reply via email to