Page 1 of 1

PDF Screengrab

Posted: 2013-11-21T01:11:43-07:00
by MikeyMike
I've been running the following code with no problems for a little while, but recently it's become a bit buggy.

It should take a grab of the first page of a PDF and creating a JPG for it. It works with some PDFs but not others and I can't work out why.

My code;

Code: Select all

exec("/usr/bin/convert 'sample.pdf' -thumbnail 200 'output.jpg' 2>&1", $array);
Any ideas or help appreciated. Our server is running the version 6.8.7-6.

Re: PDF Screengrab

Posted: 2013-11-21T03:40:08-07:00
by Bonzo
I would try changing 'sample.pdf' to 'sample.pdf[0]' as this should directly select the first page.

Are you getting any errors - what happens if it does not create an image of the first page?