To convert source test.pdf to image test.jpg

Pass this command to php function ' system()';

# gs -q -dNOPAUSE -dBATCH -sDEVICE=jpeg -sOutputFile=test.jpg test.pdf
# convert -resize 120x120 test.jpg test.jpg