3 Replies Latest reply on Nov 17, 2016 1:30 PM by Joel_Geraci

    Highlighted text to bookmark

    MotoPsycho

      I am trying to automate creating bookmarks from the highlighted text in a document.   We use the Find, Highlight and Extract action on large document files and want to have it also create a bookmarks.  This is the javascript from the action

       

      // Highlight Color

      var colHilite = color.yellow;

      var oDoc = event.target;

       

       

      var aAnnts = oDoc.getAnnots({sortBy:"Author"});

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

      {

         if(aAnnts[i].type == "Redact")

         {

            aAnnts[i].type = "Highlight";

            aAnnts[i].strokeColor = colHilite;

         }

      }

       

      I have tried to use this and then add some more code for the bookmarks but have failed.  Looking for some help on this. Thanks

        • 1. Re: Highlighted text to bookmark
          Joel_Geraci Adobe Community Professional

          Can you elaborate?

           

          I'm guessing you want the bookmark name to match the highlighted text. If that's true, the problem is a bit harder but it's not terrible. If it's not, it's pretty easy.

          • 2. Re: Highlighted text to bookmark
            MotoPsycho Level 1

            When we run the Find, Highlight and Extract action it works off the search terms (ie: pizza) and when the page is extracted it highlights the search term.  What I want to do it during this process (or after) is to have acrobat automatically create bookmark from each of the highlighted words or terms.

            I don’t care if I can do it during the Find, Highlight and Extract action or if I have to create another action and run it afterwards.

            Or simply put, create an action that will bookmark all the highlighted text in a .pdf.

            I hope I explained that better.

            • 3. Re: Highlighted text to bookmark
              Joel_Geraci Adobe Community Professional

              Ok - I'm testing my understanding... You might have search terms like "pizza", "calzone", and "stromboli". You want to search for them and highlight them. You also want to create bookmarks. If I were approaching this problem, I'd create a top level bookmark for each search term using the search term as the label. Then create a child bookmark for each page where at least one occurrence of that search term is found and then if there is more than one occurrence, an additional child that goes to the highlight.

               

              Is that what you're thinking?

               

              Also, what if a word gets hyphenated across pages?