Skip to content

Instantly share code, notes, and snippets.

@fabienduhamel
Created December 11, 2015 01:38
Show Gist options
  • Select an option

  • Save fabienduhamel/6bb078e3a2f343d58e06 to your computer and use it in GitHub Desktop.

Select an option

Save fabienduhamel/6bb078e3a2f343d58e06 to your computer and use it in GitHub Desktop.
for file in *.jpg;
do OUT=${file%*.jpg}.pdf;
convert -quality 300 -resize 60% $file $OUT;
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -sOutputFile=out.pdf $OUT;
mv out.pdf $OUT;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment