<?php /* Read page 1 */ $im = new imagick( 'test.pdf[0]' ); /* Convert to png */ $im->setImageFormat( "png" ); /* Send out */ header( "Content-Type: image/png" ); echo $im; ?>