Converting PDF to png

Using imagemagick:

convert example.pdf example.png

If you get an error about some PDF policy, make sure you have ghostcript installed (gs --version) and comment out the following line in the /etc/ImageMagick-6/policy.xml file:

<policy domain="coder" rights="none" pattern="PDF" />