The following code works like a charm:
<?php
$im = new imagick('file.pdf[0]');
$im->setImageFormat( "jpg" );
header( "Content-Type: image/jpeg" );
echo $im;
?>
But what if I need to include that image in an existing html page? If I remove the header image/jpeg it shows the image as text. I’m looking for an ImageMagick method that can do the trick. Any advice?
You would have the code above on a seperate page called something like image.php ( note you will need to remove the header part ).
Then where you want it on the main page use: