ImageMagick convert pdf with multiple pages to high quality PNG

Viewed 3506

I am trying to convert a multi-page PDF to one long png with the following command:

convert -append -flatten -density 300 in.pdf out.png

I am using -flatten to lose transparency, since I want a white background in the final PNG. The problem is that it takes only the first page instead of using all the pages.

How can I convert the PDF to one long PNG while losing the transparency and using a white background?

2 Answers

This command works for me on IM 6.9.9.22 Q16 Mac OSX with Ghostscript 9.21

convert -density 300 -colorspace sRGB itc101_13.pdf -alpha off -append out.png

enter image description here

If it does not work for you, then what is your ImageMagick version and what is your Ghostscript version.

You have your syntax wrong. You must read the PDF before applying append. Try

convert -density 300 -colorspace sRGB in.pdf +adjoin -append -background white -flatten out.png

If that does not work, then what is your ImageMagick version and platform? What is your Ghostscript version and your libpng version? Can post a link to your PDF file?

Note that +adjoin is not usually necessary for output to PNG, but won't hurt.

Related