From the python console this works:
convert -quality 100 in.pdf out.png
but when I add that command to my Python script like this:
Popen(['convert', '-quality 100', 'in.pdf', 'out.png'])
I get:
unrecognized option `-quality 100'
If I change that parameter to '-quality=100' I still get the error.
I tried fixing it like this:
Popen(['convert', '-quality', '100', 'in.pdf', 'out.png'])
which runs but fails to produce an out.png.
UPDATE: The last version is working. I must have mistyped it originally.
Every argument gets its own list element, so the second variant is correct.
You should bear in mind that until a call to
communicatefinishes, the command may still run (although that’s unlikely in your case). Checkreturncodeafter calling communicate to find out whether the program encountered any errors (like a malformed PDF file or so).Also, imagemagick convert writes out multipage PDFs to multiple PNG files (
out-0.png,out-1.png). Check whether those exist. Use-appendto supress that behavior.