setResolution( 150, 150 ); //get the first page $img->readImage( $fullpath.$pdf_file.'[0]' ); //set new format $img->setImageFormat('jpg'); // -flatten option, this is necessary for images with transparency, it will produce white background for transparent regions $img = $img->flattenImages(); //create thumbnail $img->thumbnailImage(450 , 450 , TRUE); //save image file $img->writeImage($fullpath.$save_to); echo ""; }catch (Exception $e){ print_r($e); } }else{ echo "Imagemagic not installed"; } ?>