Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pdftk and qpdf to reset PDF commenting security

Tags:

pdf

pdftk

to be able to add annotations to a pdf file in linux, i have to reset the "Commenting" security setting in the pdf document.

qpdf --decrypt input.pdf output.pdf should remove any passwords or "encryption" (according to this post)

pdftk input input.pdf output output.pdf allow AllFeatures should set all document securities (including "Commenting") to be allowed

After applying both commands, in acroread i can still see (file -> document -> security tab) that commenting is not allowed.

How can I reset this security property?

like image 917
user989762 Avatar asked May 27 '12 08:05

user989762


1 Answers

The command qpdf --decrypt input.pdf output.pdf removes the 'owner' password. But it only works if there is no 'user' password set.

Once the owner password is removed, the output.pdf should already have unset all security protection and have allowed commenting. Needless to run your extra pdftk ... command then... BTW, your allow parameter in your pdftk call will not work the way you quoted your command. The allow permissions will only be applied if you also...

  • ...either specify an encryption strength
  • ...or give a user or an owner password

Try the following to find out the detailed security settings of the file(s):

qpdf --show-encryption input.pdf
qpdf --show-encryption output.pdf
like image 138
Kurt Pfeifle Avatar answered Sep 18 '22 05:09

Kurt Pfeifle