problem running convert *. png example.pdf from php

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ricardomr
Posts: 3
Joined: 2013-01-09T13:13:32-07:00
Authentication code: 6789

problem running convert *. png example.pdf from php

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
ricardomr
Posts: 3
Joined: 2013-01-09T13:13:32-07:00
Authentication code: 6789

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

Post 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.
Post Reply