Skip to content

Instantly share code, notes, and snippets.

@ddouhine
Created December 16, 2014 15:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddouhine/6c43a58c5b58e315c86d to your computer and use it in GitHub Desktop.
Save ddouhine/6c43a58c5b58e315c86d to your computer and use it in GitHub Desktop.
Encrypt a PDF using 128-Bit Strength (the Default) and Withhold All Permissions (the Default)
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foopass
pdftk file.pdf output file_4char.pdf encrypt_40bit user_pw abcd
Same as Above, Except a Password is Required to Open the PDF
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz
Same as Above, Except Printing is Allowed (after the PDF is Open)
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foo user_pw baz allow printing
Decrypt a PDF
pdftk secured.pdf input_pw foopass output unsecured.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment