5 Replies Latest reply: Nov 24, 2010 5:05 AM by ReinhardF RSS

    Script to make the bookmarks all upper case

    dying veteran Community Member

      due to the glare from the mounitor, I want to cover all the patches by black as much as possible.


      a work around is to convert the letters to upper case.

         I think it increases the total surface area of the black.


      I wanna start with the bookmarks.


      Is there a PROGRAMMATIC way to convert all the bookmarks to UPPERCASE ?


      for example :-


      in one paper pdf in the journal of 911 studies there is a bookmark that is


      nanothermite discovery in the dust   ===>  NANOTHERMITE DISCOVERY IN THE DUST


      can you attest that the size of the black has increased ?


      I hope some kind soul here can help out.



      Dying Vets


      P.S. plssss dont be shy of VETS, we are humans too, just follow the "orders" !!!

        • 1. Re: Script to make the bookmarks all upper case
          dying veteran Community Member

          I forgot to add that .... no commercial THIRD PARTY PRODUCTS plssss - unless they are free of cost and nagware - and explain their operation.

          • 2. Re: Script to make the bookmarks all upper case
            MarkWalsh Community Member

            I don't think that changing to upper case is going to be much help; it is not going to change the proportion of black/white enough to be that big a difference, plus reading all caps is much harder on the eyes than reading upper/lower case.


            Have you looked at the accessibilty features in the OS? Both Mac and PC have options to change the display which might accomplish what you are trying to do. On the PC I believe it's under 'Accessibility' in the control panel (there's a setting I believe allows you to adjust the contrast which may reverse the display), on the Mac it's called 'Universal Access' in the control panel (you can reverse the entire monitor by choosing 'White on Black' under the display options). If you haven't, I'd check them to see if they would allow you to adjust the monitor to something that's easier to read.

            • 3. Re: Script to make the bookmarks all upper case
              ReinhardF Community Member



              function DumpBookmark(bm, nLevel)
              var s = "";
              for (var i = 0; i < nLevel; i++)
                  if (nLevel >0){
                    s= bm.name;
                    bm.name = s.toUpperCase();
                  if (bm.children != null)
                    for (var i = 0; i < bm.children.length; i++)
              DumpBookmark(this.bookmarkRoot, 0);


              HTH, Reinhard

              • 4. Re: Script to make the bookmarks all upper case
                dying veteran Community Member



                Thanks for the code.


                Could you kindly explain how it works and what are the javascript native objects and which pdf manual (page number or range) can I quickly get operational info on those specific objects without having to plough thru the whole manual.


                I think I understand the generic javascript code as it is mostly object based C-ish but I need to know the acrobat native objects.


                1) Is bm and nLevel some kind of acrobat native object or variables or attributes of some top level object ?


                2) How to modify the script if I want lower-case initials of every word, but the rest upcase like


                the following bookmark, for example




                3) I have come across something which appears to be an attachment in some pdf files and is a file of the type


                Adobe PDF Settings


                in windows. It appears to be a file that opens with









                What is such a file and how is it created and used ?




                Dying Vets

                • 5. Re: Script to make the bookmarks all upper case
                  ReinhardF Community Member

                  "but I need to know the acrobat native objects."


                  You need to download the "AcroJS.pdf" helpfile from Acrobat SDK pages.

                  The object I used is bookmark.


                  The routine to get all bookmarks "dumpBookmarks(..)" I took also from there.

                  I put only in:


                  s = bm.name;  //get the bookmark name

                  bm.name = s.toUpperCase();  //change name to uppercase


                  2) If you want to set only the first sign lowercase, then you have to write a loop which change every first sign after a space to lowercase.

                  If there is no special reason, I would concentrat on setting the font to bold and/or use special color. I think that better to read as Upper-/Lowercase or popper.


                  3) I would say: "I don't have any clue". My translator say:  "I haven't a clue."

                  However, it leeds to the same result.


                  best regards, Reinhard