Skip to content

Instantly share code, notes, and snippets.

@jingoro
Created November 7, 2012 02:54
Show Gist options
  • Save jingoro/4029324 to your computer and use it in GitHub Desktop.
Save jingoro/4029324 to your computer and use it in GitHub Desktop.
PDF Tricks
for f in *.pdf; do
echo "Extracting first page of $f..."
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=1 -dLastPage=1 \
-sOutputFile="${f}_first.pdf" \
"$f"
done
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-sOutputFile=Combined.pdf \
*.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment