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
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.
-
-
1
-
@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 \
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– HvisageNov 29, 2018 at 12:46