Hi All,

I have the following script that works fine, it createds a png of the first page of a given PDF. However I also want to screenshot the first page of a .doc file. Can this be done with imagick as well?

$im = new imagick($pdf.'[0]');
$im->setImageFormat("png");
$getfilename = preg_replace("/\\.[^.\\s]{3,4}$/", "", $pdf);
$im->writeImage("store/".$getfilename.'.png');
$im->clear();
$im->destroy();

Thanks,
Daniel

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.