View Full Version : PDF to JPG?

03-07-2007, 01:41 AM
Is it possible with PHP to read a PDF document on the server and create an on the fly thumbnail image of page 1, or any page within the PDF?

Don't need help with code, only wondering if it is possible before I attempt it.


03-07-2007, 01:59 AM
Hmm well its possible to create a pdf file using php so I would imagine that its possible to open the pdf file and get what you need from it.
If imagemagick is installed on your server then you can do it as well a little easier.

03-07-2007, 02:38 AM
You can use ImageMagick (http://www.imagemagick.org/script/index.php) to convert PDFs to basically any image format(or vise versa).

03-07-2007, 02:52 AM
You can use ImageMagik (http://www.imagemagick.org/script/index.php) to convert PDFs to basically any image format(or vise versa).

That looks like a sweet API for PHP (http://www.magickwand.org/), but can it be used with your average commercial web hosting company server space?

My guess is, unless you own and operate your own server, you won't have the opportunity to use this extension. And I doubt a commercial web hosting company would install it for you (they seem to shy away from such things).

But it looks very nice otherwise.

03-07-2007, 07:19 AM
Many hosts are already installing imagemagick by default. I did find this test suite that checks to see if imagemagick is installed or not. Its a cgi file but most servers have cgi-bins so...http://www.jmbsoft.com/software/tools/

03-07-2007, 05:11 PM
I looked up on the 1and1.com (my host) FAQ's and they do in fact support ImageMagick, but only on their Linux Hosting (not sure if this includes shared also, so I shot them an e-mail about it).

I will definitely use that script to determine if I am able to do this on my host Aero, thanks a lot.