Page 1 of 1

problem running convert *. png example.pdf from php

Posted: 2013-01-09T13:35:14-07:00
by ricardomr
hello my English is bad.

when trying to run exec('convert *.png example.pdf') from php gives me a problem, I created a file with a size in bytes and not functional. It's as if it did not obtain any file.png, however if I go from ssh to the server and run "convert *.png Example.pdf" in the same directory as the file I created example.pdf.

Then I tried this: exec('convert file-0.png example.pdf') and believe me perfectly.

no filter. that if I work exec(echo *)

there is no way to specify the images to add to pdf?
try in php: exec('convert file-0.png, file-1.png example.pdf') :(

thanks in advance.

Re: problem running convert *. png example.pdf from php

Posted: 2013-01-09T20:10:21-07:00
by fmw42
You probably need to put the path to IM convert into your exec command

Try

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>

to find the path to convert

Re: problem running convert *. png example.pdf from php

Posted: 2013-01-10T17:30:50-07:00
by ricardomr
look my problema i try this:

exec("convert file-0.png file-1.png file-2.png file-3.png file-4.png file-5.png FINAL0.pdf"); <--- failed 690bytes
exec("convert * FINAL0.pdf"); <--- failed 690bytes

exec("convert file-0.png file-1.png file-2.png file-3.png file-4.png FINAL0.pdf"); <--- works 1.25mb

i try via ssh:
convert file-0.png file-1.png file-2.png file-3.png file-4.png file-5.png FINAL0.pdf <--- works 1.90mb
-------

the php file is located in some directory that images.

that for response.