Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)?

like image 326
Rafael Beirigo Avatar asked Mar 23 '26 19:03

Rafael Beirigo


1 Answers

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!

like image 155
Rafael Beirigo Avatar answered Mar 26 '26 09:03

Rafael Beirigo