4 Replies Latest reply: Apr 22, 2012 11:28 PM by MaxineY RSS

    Bookmarks - Sentence Case

    MaxineY

      Hi

       

      Ok, so I've searched the forums and have come really really close, but just need a bit of help tweeking here ...
      I would like to change the bookmarks in Acobat PDF to Sentence case.
      eg: tommy went to the well > Tommy went to the well

       

      Searching through the forums I found this great piece of scripting that converted everything to lower case:

       

      function DumpBookmark(bm, nLevel)

      {

      var s = "";

      for (var i = 0; i < nLevel; i++)

          if (nLevel >0){

            s= bm.name;

            bm.name = s.toLowerCase();

            }

          if (bm.children != null)

            for (var i = 0; i < bm.children.length; i++)

            DumpBookmark(bm.children[i],nLevel+1);

      }

      DumpBookmark(this.bookmarkRoot, 0);

       

       

       

      HTH, Reinhard

       

       

      That worked great - but to go through all the bookmarks to change the first letter is proving to be a bigger mission then I anticipated. Can anyone assist in tweaking the above coding so that it converts to Sentence case, or perhaps provide another solution?