That is more a stackoverflow question: https://stackoverflow.com/questions/25681239/how-to-make-pdf-file-password-protected
Regards,
Ronald
you can use the Java Action Base64EncodeFile from Community Commons.
Have a look at this topic if you're looking to password protect your PDF: