Basic intro to a few pdftk functions
Hosted by klaatu on 2018-10-23 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg,
mp3 format. | Comments (3)
Pdftk is a command that lets you manipulate PDFs outside of a GUI PDF creation tool.
There are several GUI tools you can use to create PDFs with valid bookmarks and other fancy features, but pdftk is often more convenient.
Extract pages 1 through 2, and pages 5-21, and page 261 from a big PDF into a new PDF:
$ pdftk big.pdf cat 1-2 5-21 261 output small.pdf
Extract bookmarks from original PDF:
$ pdftk big.pdf dump_data output book.mark
Here is what a bookmark file looks like:
InfoValue: pdftk (Linux)
InfoValue: pdftk 2.02-x86_64
BookmarkTitle: Chapter One
BookmarkTitle: Foo Section
BookmarkTitle: Bar Baz
BookmarkTitle: Back cover
Apply the bookmark data back to the PDF:
$ pdftk small.pdf update_info book.mark output final.pdf
Comment #1 posted on 2018-10-23T18:09:38Z by b-yeezi
It's a shame that PDFtk is basically going away because the GCJ runtime has been deprecated by most major distros. PDFTK still lives on as a Snap. Also, there is a fork that uses openJDK instead. You can reference this Stack Overflow post:
Comment #2 posted on 2018-10-24T00:59:02Z by Clinton Roy
I'm rather confused about why there's a reliance on any particular java runtime, but at least on debian, if i request pdftk to be installed, pdftk-java is installed, and yeah, no screwing around required.
Comment #3 posted on 2018-10-31T09:18:23Z by Klaatu
Thanks for the snap tip
I install and use pdftk on Slackware, so far without any issue. It's good to know about its availability in snap packages, though...just in case.
<< First, < Previous, Next >, Latest >>
Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.
Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).