Skip to content

Instantly share code, notes, and snippets.

@LeoHuckvale
Created February 15, 2015 12:19
Show Gist options
  • Save LeoHuckvale/b0ec42fdec3107fe4d3d to your computer and use it in GitHub Desktop.
Save LeoHuckvale/b0ec42fdec3107fe4d3d to your computer and use it in GitHub Desktop.
Compile a PDF from a directory of JPG images using ghostscript
#! /bin/sh
parallel -j 6 jpg2pdf -- *.JPG
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=combined.pdf `ls -1 *.pdf`
mv combined.pdf combined.pdf.bak
rm *.pdf
foo="`basename "$PWD"`"
mv combined.pdf.bak "$foo.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment