Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

9. Working with Pdftk > File Attachments

File Attachments

PDF files can have attachments added at the document or page level. The technical foundations of PDF attachments are discussed in Chapter 7. To add an attachment at the file level:

pdftk input.pdf attach_files file1.xls file2.xls output output.pdf

The attachment is added to the end of the list of file-level attachments. To add an attachment at the page level, use the to_page keyword:

pdftk input.pdf attach_files file1.xls to_page 4 output output.pdf

To extract the attachments from a document, writing them to a given directory, we can use the unpack_files keyword:

pdftk input.pdf unpack_files output outputs/

This writes the attachments, under their original filenames, in the outputs directory.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint