Page 1 of 1

Trying to convert PDF to JPG through PHP

Posted: 2008-07-09T04:06:02-07:00
by Syswatch
Hi,
I have some problems with ImageMagic...
When I try to convert a PDF to a JPG I have some problems with the paths I think.

When I have the PDF's in the root of my website everything is okay, and it works.
But when I try use the convert command in a folder, nothing happens... what am I doing wrong ?

This is working:
exec("convert.exe 12345.pdf test/12345.jpg");


This is NOT working:
exec("convert.exe test/12345.pdf test/12345.jpg");


The test folder is chmod 777....

Please help me out here... I don't want to have all my PDFs in the root of my website.

Best regards,
Jesper Andersen

Re: Trying to convert PDF to JPG through PHP

Posted: 2008-07-09T04:44:18-07:00
by Bonzo
What happens if you do this:

Code: Select all

exec("convert test/12345.pdf test/12345.jpg");

Re: Trying to convert PDF to JPG through PHP

Posted: 2008-07-09T05:04:34-07:00
by Syswatch
The problem is... nothing happens.

Re: Trying to convert PDF to JPG through PHP

Posted: 2008-07-09T06:51:44-07:00
by forumim
try:

Code: Select all

$input = 'test/12345.pdf';
exec("convert $input test/12345.jpg");
See:
http://www.rubblewebs.co.uk./imagemagick/notes/info.php