Search code examples
pdfcommand-lineannotations

Remove PDF annotations via command line


Is there a way to remove all PDF annotations (including highlights, comments, notes, arrows) in bulk (e.g., via command line)?


Solution

  • The following series of commands solved my problem:

    pdftk in.pdf output - uncompress | sed '/^\/Annots/d' | pdftk - output out.pdf compress
    

    Thanks @Farid Cheragi for the oneliner!