Trying to convert PDF to JPG through 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
Syswatch

Trying to convert PDF to JPG through PHP

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Trying to convert PDF to JPG through PHP

Post by Bonzo »

What happens if you do this:

Code: Select all

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

Re: Trying to convert PDF to JPG through PHP

Post by Syswatch »

The problem is... nothing happens.
forumim

Re: Trying to convert PDF to JPG through PHP

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