Skip to content

Instantly share code, notes, and snippets.

@awsong
Created October 27, 2011 14:03
Show Gist options
  • Save awsong/1319621 to your computer and use it in GitHub Desktop.
Save awsong/1319621 to your computer and use it in GitHub Desktop.
Combine scanned TIFF to a single PDF
#!/bin/bash
for X in "$@"
do
convert "$X" -compress jpeg -quality 50 "${X%%tiff}pdf"
done
echo "${@/tiff/pdf}"
pdftk "${@/tiff/pdf}" cat output out1.pdf
pdfopt out1.pdf finish.pdf
rm -rf out1.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment