How can I list the named destinations in a PDF file?
Named destinations are the formal name for what you might call anchors. Major browsers jump to the named destination foo
when you follow a link to http://example.com/some.pdf#foo
.
I have documents where I can see anchors working, but I can't seem to find a way to list the anchors. Evince, okular and xpdf will jump to them when instructed but don't seem to have an interface that lists them. pdftk dump_data
lists bookmarks, but that's not the same thing (that's table of content entries, which may well be at the same position as named destinations but can't be used as anchors).
I'm looking for a command line solution (suitable, for example, for use in a completion function after the likes of evince -n
). Inasmuch as this is meaningful, I'd like to list the destinations in the order in which they appear in the document. Bonus: show the target page number and other information that helps figure out approximately where the destination is.
See also View anchors in a PDF document on Software Recommendations for a GUI viewer.