Postscript to pdf
Christian Gollwitzer
auriocus at gmx.de
Wed Sep 23 02:40:58 EDT 2015
Am 21.09.15 um 17:20 schrieb Baladjy KICHENASSAMY:
> Hello,
> This is my programe : on mac i was able to output ps file but i didn't
> got the pdf file :/
Maybe ps2pdf is not installed? I think it doesn't come with the Mac. You
need to get it via fink, homebrew, macports or an official ghostscript
binary. The same holds true for convert, which is a tool from ImageMagick.
Yet another option would be to wrap the pdf4tcl library:
http://sourceforge.net/projects/pdf4tcl/
It can create PDF from a canvas without an external dependency. The Tcl
code for it looks like this:
> package require pdf4tcl
> set size [list [winfo width $win] [winfo height $win]]
> set pdf [pdf4tcl::new %AUTO% -paper $size -compress false]
> $pdf canvas $win
> $pdf write -file $fn
> $pdf destroy
In principle, you could run this code via Tkinter.eval()
You would need to set "win" to your canvas path and "fn" to the file
name path.
Yet another option would be to use a Python package like Reportlab to
create the PDFs, which requires you to reimplement the drawing code.
Christian
More information about the Python-list
mailing list