$im = new imagick('test.pdf[0]'); //1st page
$im->setImageFormat('png');
header('Content-Type: image/png');
echo $im;


more