Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have several PDF documents which have the "no copy" and "no print" restriction bits set. Are there any free tools for removing such restrictions, on Linux?

(Please do not suggest pdf2ps | ps2pdf; the size increase is horrible. The originals are fairly large too, so I'd rather use a local tool than a website.)

share|improve this question
Willing to write any code or are you wanting something out of the box? – Aaron McIver Dec 12 '11 at 15:08
Code is okay, although I have a feeling it'll be C, and my C skills are limited to "Hello world". – grawity Dec 12 '11 at 15:13
You could use iText; this can be done in Java. – Aaron McIver Dec 12 '11 at 15:30
up vote 2 down vote accepted

FOSS-wise, there is PDFCrack, not sure if it does actually remove the security though, it's just a password cracker. I generally turn to some free trial software, A-PDF Restrictions Remover, it's easier to use.

It might be a lot harder if it's a recent PDF version though, I think they really increased the security recently.

share|improve this answer
Ended up buying the A-PDF tool. – grawity Jun 22 '15 at 10:07

With qpdf:

$ qpdf --decrypt input.pdf output.pdf
share|improve this answer
qpdf works very well. There is a convenient pre-built Windows binary, which is a plus. – Li-aung Yip Mar 19 '15 at 4:04

You can probably use pdftk. Something like

pdftk in.pdf output out.pdf allow AllFeatures

should do the job.

share|improve this answer
This would work if the password is known. – Scott McClenning Dec 13 '11 at 2:39
I'm probably a few years late, but the owner password does not have to be known for this, just the user password, if there's any. It warns you not to abuse the power to simply remove the owner password and the limitations altogether, but does it without further complaining. I think this should be the accepted answer. – matega Dec 10 '14 at 8:04

If you've got ghostscript installed try simply:

gs -sPDFPassword=$PASS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%stdout% -c .setpdfwrite -f locked.pdf > unlocked.pdf
share|improve this answer
"simply". Lol :) – Likso Sep 11 '13 at 13:38
+1 and found a variation online: gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf. Worked for me in a few seconds, faster than brute-forcing a password... – bufh Jul 9 at 15:51
Side note, in my case the original file was 10 MB, after gs it was 3.7 MB. – bufh Jul 9 at 16:01

You must log in to answer this question.

protected by Community Aug 7 '13 at 6:39

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .