5 Replies Latest reply on Sep 28, 2008 9:54 AM by Peter Spier

    Renaming Bookmarks

    Peter Spier Most Valuable Participant (Moderator)
      I just finished a project in InDesign which was then exported to PDF to make a slide show of 517 slides, each with a title that was bookmarked by creating a Table of Contents in InDesign.

      My problem is that all of the titles were in the form of 000-A[A] where the first three characters were a three-digit number, and the fourth and optional fifth were letters. The ID document was created using Data Merge, and in the original data file there were no hyphens, making some of the combinations difficult to read. I used GREP to add the hyphen with a thin space on either side to achieve the look I wanted before adding the TOC.

      After export to PDF I discovered that the bookmarks generated all had little square boxes around the hyphens representing missing glyphs for the thin spaces. I presume this is due the choice of font used by the OS to display the bookmark links, and I don't see any way to control that on my own system, let alone on a remote user system.

      I worked around this by removing the thin spaces from the titles and re-exporting the PDF, but I would have preferred to leave them in. Is there any way to run a script in Acrobat, similar to running a find/change in ID, that would go through and automatically rename 500+ bookmarks, removing the unavailable thin space characters while leaving them in place on the page?

      Peter
        • 1. Re: Renaming Bookmarks
          gkaiseril MVP & Adobe Community Professional
          Possible with JavaScript and RegExp, but not a novice's task.
          • 2. Re: Renaming Bookmarks
            try67 MVP & Adobe Community Professional
            Hi Peter, I think it's possible. I've recently finished working on a large bookmarks script so I have some ideas. If you want, contact me by email for more info.
            • 3. Re: Renaming Bookmarks
              Peter Spier Most Valuable Participant (Moderator)
              Although the project is now out the door, I'd be interested in some hints. I'd say I'm a "literate novice" in that I used to write a bit of Java code now and then, and at least understand the syntax in javascript, and I'm starting to learn GREP for use in ID, so the concept isn't foreign.

              Is there a reference on the DVD or something for finding the right names for properties in Acrobat?

              Now that I know you can use javascript to alter the file itself, rather than just perform a secondary action, I'd approach this in terms of creating a bookmark array and looping through it looking for instances of the offending characters (thin spaces in this case) and removing or replacing as you go.

              While you are being this helpful, is there any way to change the font in the bookmarks panel?

              Peter
              • 4. Re: Renaming Bookmarks
                try67 MVP & Adobe Community Professional
                Hi Peter,

                You should get "the bible" for these things...
                http://www.adobe.com/devnet/acrobat/pdfs/AcroJS.pdf
                For your purposes, look especially under "Bookmark Object".

                As for changing the names, you don't need an array, just a recursive loop that goes over all the bookmarks and changes them, more or less as you described it.

                About the font, you can't change the font itself, but you can change it's style (regular, italic, bold, italic-bold) and color.
                • 5. Re: Renaming Bookmarks
                  Peter Spier Most Valuable Participant (Moderator)
                  Thanks.