converting from .pdf to .jpg

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
bhavya

converting from .pdf to .jpg

Post by bhavya »

i have installed ImageMagick 6.5.8-Q16
Ghost script and
XAMpp

now i m trying to convert .pdf file to .jpg
code:
<?php
exec("convert inline.pdf inline.jpg") or die("couldn't convert the pdf");
?>
error:
couldn't convert the pdf

i have some more questions like
1.do i need to put this inline.pdf file in Images folder of imagemagick
2.if it is converted from .pdf to .jpg where this .jpg file will be created
3.how to print this .jpg file
can anyone please help me.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: converting from .pdf to .jpg

Post by Bonzo »

The path to inline.pdf is relative to the file and so is the output.

To start put inline.pdf in the same folder as the file, run the code and the jpg will be created in the same folder.

I can not remember if you need to install ghostscript first or second.

I do not get the problem but some people have a problem with windows selecting its convert program not the IM one. I beleve you can rename the IM convert program to something like imconvert and use imconvert instead of convert.
Also this post may be helpful: viewtopic.php?f=1&t=15240&p=53702#p53702
Post Reply