Skip to main content
Known Participant
September 20, 2022
Answered

Select or highlight Destination Text

  • September 20, 2022
  • 1 reply
  • 430 views

 

 

In my content file generating Hyperlink on Text (format is Times, 😎

 

and Hyperlink Text Destination on same Text with diff format (Times, 9)

 

Now, in PDF file when user clicks on the Link, is there any way to select Destination Text OR Highlight the Destination Text OR put the cursor blinking, as there are lot of content in the file so it is difficult to identify the Text on which it is jumped...?   

 

  

 

++++++++++++++++++++++

 

Below is the code

 

   //find R Number is Hyperlink and Ref is Hyperlink destination

 

   app.findGrepPreferences = app.changeGrepPreferences = null;

 

   app.findGrepPreferences.properties = ({findWhat: "(R+[\\d]+)", pointSize:"8", appliedFont:"Times"});

 

   var RNumberObject = doc.findGrep();

 

           

 

   var hName, hypTextDest, hypSource, hyperlink, destNumberObject;

 

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

 

      

 

        hName = RNumberObject[i].contents;

 

   

 

        app.findGrepPreferences = app.changeGrepPreferences = null;

 

        app.findGrepPreferences.properties = ({findWhat: hName, pointSize:"9", appliedFont:"Times"});

 

        destNumberObject = doc.findGrep();

 

       

 

        if(destNumberObject.length > 0) {

 

               

 

            hypTextDest = doc.hyperlinkTextDestinations.add(destNumberObject[0], {name: hName});

 

            hypSource = doc.hyperlinkTextSources.add(RNumberObject[i], {name: hName});

 

            hyperlink = doc.hyperlinks.add(hypSource, hypTextDest, {name: hName, borderStyle: HyperlinkAppearanceStyle.DASHED, visible: true});

 

        }

 

    }

This topic has been closed for replies.
Correct answer Peter Kahrel

It's not possible to code something in InDesign so that a link's destination is selected in any visible way in the PDF.

1 reply

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
September 21, 2022

It's not possible to code something in InDesign so that a link's destination is selected in any visible way in the PDF.

Hetal5C4CAuthor
Known Participant
September 21, 2022

Is it possible by scripting in Adobe PDF, to get the Hyperlink Text on which I've clicked?

So by finding the same Text and Highlight it in next occurance.

 

Thank you.

 

 

 

 

Peter Kahrel
Community Expert
Community Expert
September 22, 2022

Maybe. You'd have to ask in the Acrobat forum.