i'm new here but i've already found help for different problems!
i want to generate a jpeg-thumbnail from an online-generated pdf, but the pdf is generated from a php script... so i've to link to a .php script and not to a .pdf file. is that possible?
but my problem first is, when i simply link to a normal .pdf file i get no error, but also no picture. in safari there's only a icon like this: failure image
and firefox shows something like "the image has an error" but that's a text from the browser.
my code:
<?php
$file = 'templates/pdf/standard/test_doc.pdf';
$im = new imagick(realpath($file).'[0]');
$im->setImageFormat("jpg");
$im->resizeImage(200,200,1,0);
header("Content-Type: image/jpeg");
// start buffering
ob_start();
$thumbnail = $im->getImageBlob();
$contents = ob_get_contents();
ob_end_clean();
echo "<img src='data:image/jpg;base64,".base64_encode($contents)."' />"
?>
Thanx a lot for your help!