2

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.

1

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. – Shane Di Dona Nov 19 '14 at 1:35
  • 1
    @ShaneDiDona Ideally yes, that's what I'm looking for. – Pierce Nov 19 '14 at 2:19
  • @ShaneDiDona: why a 'series of commands' if a simple one is all you need? :-) – Kurt Pfeifle Dec 16 '14 at 16:02
0

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 \
  9page.pdf
  • 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 '18 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.