pdftk and qpdf to reset PDF commenting security
Asked Answered
T

2

20

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?

Thrum answered 27/5, 2012 at 8:32 Comment(1)
I have to remove input from pdftk on my system: pdftk input.pdf output output.pdf allow AllFeatures.Bounty
S
22

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
Stamp answered 27/5, 2012 at 11:20 Comment(0)
H
3

The question is a common one and the answer is simple. Do not use acroread to check a document's security settings. qpdf is correctly removing the restrictions, but acroread does not know that.

Acroread is purposefully limited by Adobe so that it will not compete with Acrobat. (For example, you can type in forms, but you can't save the document).

Hanleigh answered 11/6, 2015 at 6:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.