Rafael Beirigo
Rafael Beirigo

Reputation: 1792

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

Upvotes: 9

Views: 4278

Answers (2)

Rafael Beirigo
Rafael Beirigo

Reputation: 1792

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!

Upvotes: 14

Frederick Nord
Frederick Nord

Reputation: 1304

pdfcpu has a subcommand to remove annotations:

pdfcpu annotations remove my.pdf

Upvotes: 4

Related Questions