Skip to content

Instantly share code, notes, and snippets.

@sellth
Forked from stefanschmidt/remove-annotations.sh
Created August 17, 2017 15:20
Show Gist options
  • Select an option

  • Save sellth/03e581b97355f37448a1bcf7924dd4b7 to your computer and use it in GitHub Desktop.

Select an option

Save sellth/03e581b97355f37448a1bcf7924dd4b7 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