I\'m trying to convert a PDF to a PNG image (at least the cover of one). I\'m successfully extracting the first page of the PDF with pdftk. I\'m using imagemagick to do the
I'll add my solution, even thought his thread is old. Maybe this will help someone anyway.
First, I need to generate the PDF. I use XeLaTeX for that:
xelatex test.tex
Now, ImageMagick and GraphicMagic both parse parameters from left to right, so the leftmost parameter, will be executed first. I ended up using this sequence for optimal processing:
gm convert -trim -transparent white -background transparent -density 1200x1200 -resize 25% test.pdf test.png
It gives nice graphics on transparent background, trimmed to what is actually on the page. The -density
and -resize
parameters, give a better granularity, and increase overall resolution.
I suggest checking if the density can be decreased for you. It'll cut down converting time.