Pack or unpack PDF attachments from the Windows File Explorer with a quick right-click.
It's best to perform simple tasks in a simple manner, especially when you must perform them often. Wire pdftk [Hack #79] into Windows Explorer so that you can pack or unpack attachments using PDF's right-click context menu.
In Windows XP and Windows 2000:
In the Windows File Explorer menu, open Tools Folder Options . . . and click the File Types tab. Select the PDF file type and click the Advanced button.
Click the New . . . button and a New Action dialog appears. Give the new action the name Attach File.
Give the action an application to open by clicking the Browse . . . button and selecting cmd.exe, which lives somewhere such as C:\windows\system32\ (Windows XP) or C:\winnt\system32\ (Windows 2000).
Add these arguments after cmd.exe, changing the path to suit, like so:
C:\windows\system32\cmd.exe /C C:\windows\system32\pdftk.exe "%1" attach_file PROMPT output PROMPT
Click OK, OK, OK and you should be done with the configuration.
Follow the previous procedure, except name the action Unpack Attachments and replace the cmd.exe arguments in step 4 with:
/C C:\windows\system32\pdftk.exe "%1" unpack_files
Right-click your PDF of interest and select Attach File or Unpack Attachments from the context menu. A command prompt will open and ask for additional information. Upon success, the command prompt will close. 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.