Search code examples
encryptionparametersqpdf

Qpdf fails to encrypt without passwords


I'm trying to add restriction to a pdf file, but don't need a user password. I fail to get this right for some reason.

qpdf.exe --encrypt 40 -modify=y -extract=y -annotate=y -- in.pdf out.pdf

The help states that:

Either or both of the user password and the owner password may be empty strings.

How should I specify the empty password strings?


Solution

  • You should use quotation marks to specify empty strings as password:

    qpdf.exe --encrypt "" "" 40 -modify=y -extract=y -annotate=y -- in.pdf out.pdf