Skip to content

Instantly share code, notes, and snippets.

@munk
Last active December 17, 2015 11:59
Show Gist options
  • Save munk/5606104 to your computer and use it in GitHub Desktop.
Save munk/5606104 to your computer and use it in GitHub Desktop.
An OSX script for converting and joining jpegs to pdfs. Useful for combining scans into documents for a paperless office.
#!/bin/bash
MAX=$[$2+1]
for ((i = $1; i < $MAX; i++)) do
#echo "sips -s format pdf \"Scan $i.jpeg\" --out \"Scan$i.pdf\""
sips -s format pdf "Scan $i.jpeg" --out "Scan$i.pdf"
done
PDFconcat="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py"
echo 'PDFconcat -s -o $3 Scan[$1-$2].pdf'
`"$PDFconcat" -s -o $3 Scan[$1-$2].pdf`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment