Skip to main content
gsechler84
Participant
August 11, 2017
Question

Format Dead Bookmarks

  • August 11, 2017
  • 1 reply
  • 275 views

Hello All,

I was wondering how difficult it would be to write a script that would go through all my bookmarks in the current PDF and mark those bookmarks that are dead and don't lead anywhere in a specific manner? Maybe bold and in red font?

We send PDF documents back and forth with clients and between our changes and their's, we often end up with dead bookmarks in the file and I'd like an easy way to identify and resolve those.

Any help would be greatly appreciated! THank you!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 11, 2017

Are these bookmarks only pointing to pages in the same file, or can they do other things as well? If the former then it might be possible to do it with a script, but it's quite tricky.

gsechler84
Participant
August 11, 2017

All the bookmarks are just pointing to pages in the same file. Nothing outside.

try67
Community Expert
Community Expert
August 11, 2017

In that case it might be possible. You would need to write a recursive function to iterate over the entire bookmarks hierarchy, executing each one and checking whether it's causing the document to change page number. If you do that multiple times and it never changes, it's most likely a dead bookmark.