Skip to content

Instantly share code, notes, and snippets.

@ppalaciosa
Forked from stefanschmidt/remove-annotations.sh
Created October 10, 2018 22:35
Show Gist options
  • Select an option

  • Save ppalaciosa/227e0fc39dd1b1bf2ea332c7e0c7b2ed to your computer and use it in GitHub Desktop.

Select an option

Save ppalaciosa/227e0fc39dd1b1bf2ea332c7e0c7b2ed 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