< Day Day Up > |
Hack 53 Add PDF Encryption Actions to Windows Context Menus
Apply or remove encryption from a given PDF with a quick right-click . [Hack #52] discussed how to apply or remove PDF encryption with pdftk [Hack #79] . Let's streamline these security operations by adding handy Encrypt and Decrypt items to the PDF context menu. The encryption example simply applies a user password to the selected PDF, so nobody can open it without the password. The decryption example removes all (Standard) security, upon success. 5.4.1 Add the Encrypt PDF Context Menu ItemWindows XP and Windows 2000:
5.4.2 Add the Decrypt PDF Context Menu ItemFollow the preceding procedure, except name the action Decrypt and replace the cmd.exe arguments in step 4 with: C:\windows\system32\cmd.exe /C C:\windows\system32\pdftk.exe "%1" input_pw PROMPT output "%1.decrypted.pdf" 5.4.3 Using Encrypt or DecryptRight-click your PDF of interest and select Encrypt or Decrypt from the context menu. A command prompt will open and ask for the password. Upon success, the command prompt will close. pdftk will create a new PDF file with a name based on the original PDF's filename. If pdftk has trouble executing your request, the command prompt will remain open with a message. Press Enter to close this message. If you invoke one of these commands on a selection of multiple PDFs, you will get one command prompt for each PDF. |
< Day Day Up > |