Skip to content

Instantly share code, notes, and snippets.

@Gabriel-p
Forked from stefanschmidt/remove-annotations.sh
Created September 16, 2016 13:31
Show Gist options
  • Save Gabriel-p/c67f74fa32566251490de307c088d851 to your computer and use it in GitHub Desktop.
Save Gabriel-p/c67f74fa32566251490de307c088d851 to your computer and use it in GitHub Desktop.
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment