Removing PDF usage restrictions [duplicate]

Solution 1:

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.

Solution 2:

With qpdf:

$ qpdf --decrypt restricted-input.pdf unrestricted-output.pdf

Solution 3:

You can probably use pdftk. Something like

pdftk in.pdf output out.pdf allow AllFeatures

should do the job.

Solution 4:

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