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:
array_filter ------------ .. class:: description Filters elements of an array using a callback function .. class:: prototype array array_filter(array $array , [callable $callback ] ) .. class:: params **array** - The array to iterate over .. class:: params **callback** - The callback function to use .. class:: return Returns: Returns the filtered array.
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.