Script seems to use pdf2ps and ps2pdf commands/programs. I was able to use these in a shell script to change the permissions. Only thing is that my method inflates the size of the pdf when graphics/binary data or unknown/special fonts are used in the pdf. In the rest of the cases of ordinary text pdfs, output pdfs are generally smaller in size.
password protected files must first be opened using pdftk and the password (owner or user as the case may be) and the password restrictions removed before they can be manipulated.
Without the password, pdftk cannot change any restrictions.
Kussh