Skip to content

Instantly share code, notes, and snippets.

@ClemRz
Created September 9, 2019 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ClemRz/df3d2381661a53ab5cbf1552980a19e1 to your computer and use it in GitHub Desktop.
Save ClemRz/df3d2381661a53ab5cbf1552980a19e1 to your computer and use it in GitHub Desktop.
Resize images and put them into a single pdf using ImageMagick

Resize images and put them into a single pdf

First install ImageMagick

Run the following commands:

mogrify -resize 663x1024 *.jpg
for i in `seq 0 26`; do convert $(printf "filename-%03d" $i).jpg $(printf "filename-%03d" $i).pdf; done  
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=temp.pdf $(for i in `seq 0 26`; do printf "filename-%03d.pdf " $i; done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment