Create pdf preview thumbnail using php

Following the stackoverlow answer http://goo.gl/z9IWCB I did everything correct as mentioned in the answer to create pdf preview thumbnail using php but I struck with an error as such as this.

error no decode delegate for this image format `\path\filename.pdf’ @ error/constitute.c/ReadImage/532″.

I tried many things to rectify it but as not being a server guy I could not find a working solution to it. Then, after following an advice found in some online forum, I tried:

$exec = "convert -scale $width $source $dest";
exec($exec);

And it worked like a charm.

Thought it could be helpful for someone to create pdf preview thumbnail using php.

Leave a Reply

Your email address will not be published. Required fields are marked *