I am trying to use the script from Paolo Bergantino How do I convert a PDF document to a preview image in PHP? After my hosting has installed the Imagick I am now struggling to get the code working.
What I see is a raw image with lots of questionmarks being generator with ImageMagick and GhostScript.
$im = new imagick('Maps.pdf[0]');
$im->setImageFormat('jpg');
//header('Content-Type: image/jpeg'); (updated ro remove header error)
echo $im;de
What am I doing wrong? Jan
SOLVED: by solving the header problem (extra white spaces) the image is shown!