Skip to content

Instantly share code, notes, and snippets.

@searls
Created October 25, 2013 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searls/7162798 to your computer and use it in GitHub Desktop.
Save searls/7162798 to your computer and use it in GitHub Desktop.
Flatten PDF files with annotations to lock them down. Requires ghostscript (`brew install ghostscript`)
#!/bin/bash
FILE="$1"
OLD_FILE="$1-og.pdf"
mv "$FILE" "$OLD_FILE"
pdf2ps "$OLD_FILE" - | ps2pdf - "$FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment