ImageMagick
Trim transparent pixels from an image:
convert input.png -fuzz 0% -trim +repage output.png
Convert PDF to JPG:
convert -density 70 -quality 100 -flatten input.pdf output.jpg
Add drop shadow:
NOTE: 20x4+0+0
is 20% opacity, 4px sigma (blur amount), 0 horizontal offset, 0 vertical offset.
convert input.jpg \( +clone -background black -shadow 20x4+0+0 \) +swap -background none -layers merge +repage output.png