Skip to main content
Participant
March 2, 2016
Answered

Removing "/" from the middle of multiple bookmarks?

  • March 2, 2016
  • 1 reply
  • 749 views

Hi,

Needing some help/action to remove  the "/" which is in the  middle of multiple bookmarks i.e.. "123456789012/ 12345".

Ideally look to save as "123456789012-12345" so the file can be split into individual pages named as the bookmarks 123456789012-12345.pdf

Using Acrobat X Pro.

Thanks,

Kenny

This topic has been closed for replies.
Correct answer George_Johnson

You can run the following script in the interactive JavaScript console (Ctrl+J) or place it in the Mouse Up event of a temporary button and click it to execute the code.

function updateBookmarkName(bkm, nLevel){

    // Replace the "/ " character combination with "-"

    bkm.name = bkm.name.replace(/\/ /g, "-");

    if (bkm.children) {

        for (var i = 0; i < bkm.children.length; i += 1) {

            updateBookmarkName(bkm.children, nLevel + 1);

        }

    }

}

updateBookmarkName(bookmarkRoot, 0);

1 reply

George_JohnsonCorrect answer
Inspiring
March 3, 2016

You can run the following script in the interactive JavaScript console (Ctrl+J) or place it in the Mouse Up event of a temporary button and click it to execute the code.

function updateBookmarkName(bkm, nLevel){

    // Replace the "/ " character combination with "-"

    bkm.name = bkm.name.replace(/\/ /g, "-");

    if (bkm.children) {

        for (var i = 0; i < bkm.children.length; i += 1) {

            updateBookmarkName(bkm.children, nLevel + 1);

        }

    }

}

updateBookmarkName(bookmarkRoot, 0);

Participant
March 3, 2016

Fantastic George, thanks for your help it works a treat. Just started using Acrobat this week and was in need of much needed support.