I've seen a lot of posts about how to convert a multi-page PDF to PNG but I'm wondering how I can go in the opposite direction if I have the size of each page I want made.

2 Answers 2


Print the PNG files to PDF. By default, the PDF pages will all be the same size but you can crop them down once it is created.

  • I think he may be looking for a series of commands. Nov 19, 2014 at 1:35
  • 1
    @ShaneDiDona Ideally yes, that's what I'm looking for.
    – Pierce
    Nov 19, 2014 at 2:19
  • @ShaneDiDona: why a 'series of commands' if a simple one is all you need? :-) Dec 16, 2014 at 16:02

Assuming you have PNG files page1.png, page2.png,... page9.png and you want to create a 9-page PDF from these input PNGs.

The following simple ImageMagick command does create this PDF:

 convert page*.png 9page.pdf

If you want to re-sort the pages, just list all the PNGs in the order you want:

convert     \
  page8.png \
  page7.png \
  page6.png \
  page9.png \
  page1.png \
  page2.png \
  page3.png \
  page4.png \
  page5.png \
  • Strange doing that, I get the number of pages, but only the first pages shows anything ;( ➜ 2018-11-29 convert --version Version: ImageMagick 7.0.8-14 Q16 x86_64 2018-10-25 imagemagick.org Copyright: © 1999-2018 ImageMagick Studio LLC License: imagemagick.org/script/license.php Features: Cipher DPC HDRI Modules Delegates (built-in): bzlib freetype jng jp2 jpeg lcms ltdl lzma png tiff webp xml zlib
    – Hvisage
    Nov 29, 2018 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.