Printing PDF Bookmarks List
I used a tool called pdftk which is excellent, I’ve used it before for doing various other PDF-related things. To grab metadata such as bookmarks, use the dump-data command, like this:
pdftk myfile.pdf dump_data | grep BookmarkTitle > outline.txt
The above line takes all the bookmarks from the PDF (this was a slide deck created using powerdot and LaTeX, the section and slide titles nest appropriately), and outputs a bunch of information about the document and the various PDFs. The grep
command just gets the lines containing “BookmarkTitle”, then the whole thing gets written to a file. I cleaned that up and now I have the outline of my course, so I can add timings, notes for the exercises and so on.
Hi Lorna, where is the text file saved, I can’t find it, or it didn’t actually do it. Are there no requirements for indicating source and output directories?
The textfile is at the very end of the command after the “>” – so in this example, the file is “output.txt” in the directory you ran the command from. Hope that helps.