52

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?

I tried pdf2ps | ps2pdf but the size increase is horrible. The originals are fairly large too, so I'd rather use a local tool than a website.

jww
  • 12,722
grawity
  • 501,077

4 Answers4

114

With qpdf:

$ qpdf --decrypt restricted-input.pdf unrestricted-output.pdf
tokland
  • 1,370
37

You can probably use pdftk. Something like

pdftk in.pdf output out.pdf allow AllFeatures

should do the job.

u-punkt
  • 546
20

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
thebodzio
  • 578
  • 2
  • 10
4

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.

Hydaral
  • 1,760
  • 9
  • 11