Tuesday, June 8, 2010

encrypted pdf files

managed to get a pdf file with restricted permissions using pdftk (pdf toolkit). the man page was a bit unclear on this, since if you just put in an owner password it will not actually restrict the file and no passwd is requested (or needed) to open it. this will do the trick, with all restrictions:
pdftk in.pdf output out.pdf user_pw foo
or, to make 2 levels of access:
pdftk in.pdf output out.pdf owner_pw baz user_pw foo
now the restrictions will be in place if you put in foo as the passwd, but they will not if you put in baz.

No comments: