Unprotect a protected pdf

If you're not averse to using the terminal, there's a package called qpdf that you can install. It's in the software center. To remove protections from your file you can use something like this:

qpdf --password=your_password --decrypt yourfile.pdf output.pdf

That should do the job. As a side note, another useful (also command line) tool to have for working with pdf files is pdftk.
Example from man pdftk:

pdftk secured.pdf input_pw foopass output unsecured.pdf

Hope that helps!


On Ubuntu 18.04 neither of two commands worked! (I don't know why). I followed the instructions to install pdftk (since it's no included in the repositories). However I figured it out (I think) in a simple way...

  1. evince mydocument.pdf
  2. ctrl+p
  3. Print to File (choose a new file name (or overwriting))

That's it, I could to highlight with Foxit Reader.


Install Ghostscript and then run:

gs -sPDFPassword="$PASS" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%stdout% -c .setpdfwrite -f locked.pdf > unlocked.pdf

Use this zsh function:

pdf-unencrypt () {
    : "Usage: <file>
Uses ghostscript to rewrite the file without encryption."
    local in="$1"
    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="${in:r}_unencrypted.pdf" -c .setpdfwrite -f "$in"
}

: is a no-operations function. $in:r gets the variable without its extension. You obviously need ghostscript installed.