Postscript to pdf

Laura Creighton lac at openend.se
Mon Sep 21 00:50:12 CEST 2015


In a message of Sun, 20 Sep 2015 23:11:20 +0200, Baladjy KICHENASSAMY writes:
>well one more question :/
>
>i tried this
>
>def save():
>     Canevas.update()
>     Canevas.postscript(file=tkFileDialog.asksaveasfilename(),
>colormode='color')
>     subprocess.call(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"])
>
>
>i got the ps file but i didn't get the pdf file :/

It's 00:41 here in Sweden, and I have an 08:00 meeting.  I am off to bed.
Perhaps somebody else can help now, otherwise I will be back
tomorrow.

I've never tried to get subprocess to run as part of a savefile dialog.
Try building a tkinter app that takes a filename argument (somepostscript
file you have lying around) and then push the button, in the same dir
makes a pdf of your ps using subprocess.

If that works, then see about getting save to run that subprocess as
part of the save process.  I am very curious about whether that can
be done -- but first check that your subprocess is working, period.
The wretched thing is slightly different between windows and linux,
and even between different linuxes, so needing to fiddle a bit here is
normal (and frustrating).

So right now I cannot tell if your problem is 'save doesn't like
it like that' or 'your subprocess isn't working'.

But nothing in Tkinter likes 'Canevas' -- (which is great French
but rotten English) you must have written Canvas in your code.

Paste the real thing in next time, ok?

Sorry I am off now,
Laura


More information about the Python-list mailing list