Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Last active February 1, 2024 17:01
Show Gist options
  • Save stefanschmidt/5248592 to your computer and use it in GitHub Desktop.
Save stefanschmidt/5248592 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
@jfines
Copy link

jfines commented Aug 23, 2023

Still works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment