I'm usually able to use ghostscript to convert PDFs to PNGs with the command:
gs \
-q \
-dNOPAUSE \
-dBATCH \
-sDEVICE=pnggray \
-g2550x3300 \
-dPDFFitPage \
-sOutputFile=output.png \
input.pdf
But this doesn't work for some PDF files. For example, the command above converts this PDF file to this PNG -- the original PDF is just a small image in the lower left corner of the PNG, instead of filling the entire page.
Is there a more robust way to convert PDFs to PNGs with ghostscript, or perhaps some other command line tool?
Note: If I generate a new PDF file from the problematic one via "print -> save as pdf" in Preview on OS X, then the command works fine.