Copy link to clipboard
Copied
I have a pdf file with many hyperlinks, all of them work well when clicking on them, also the hand icon appears when hovering on them, but they are not highlighted so users do not notice them.
I can highlight them one by one right-clicking on them > Edit Link > Link Type == Visible rectangle & Color == blue but this is not efficient.
Example:
In the following text the red-underlined text are hyperlinks and work well, the 1st one is intuitive because it has url nomenclature, but the 2nd one is not noticeable:
I am looking for a way to highlight all my hyperlinks automatically.
I am using Adobe Acrobat Pro DC.
PDF Version: 1.4 (Acrobat 5.x)
You can use this code to edit all the links in the file in this way:
for (var p=0; p<this.numPages; p++) {
var box = this.getPageBox("Crop", p);
var links = this.getLinks(p, box);
if (links==null || links.length==0) continue;
for (var i in links) {
links[i].borderColor = color.blue;
links[i].borderWidth = 1;
}
}
And since you have Acrobat Pro you can even use it in an Action to process all the links in multiple files in a single process.
PS. You should post your questions in the Ac
...Copy link to clipboard
Copied
Highlight in the original document. Too late once it’s a PDF.
Copy link to clipboard
Copied
You can use this code to edit all the links in the file in this way:
for (var p=0; p<this.numPages; p++) {
var box = this.getPageBox("Crop", p);
var links = this.getLinks(p, box);
if (links==null || links.length==0) continue;
for (var i in links) {
links[i].borderColor = color.blue;
links[i].borderWidth = 1;
}
}
And since you have Acrobat Pro you can even use it in an Action to process all the links in multiple files in a single process.
PS. You should post your questions in the Acrobat forum in the future...
Copy link to clipboard
Copied
this worked great, thanks
Copy link to clipboard
Copied
But this puts a border on it - what's the code to make it highlight on hover?
Copy link to clipboard
Copied
That's not possible with a link. You will need to use a button for that, and then you could change its appearance using the Mouse Enter and Mouse Exit functions to highlight it when you hover with the mouse cursor over it.
Copy link to clipboard
Copied
Thanks, but can you please say how to run this code?
Copy link to clipboard
Copied
Press Ctrl+J, paste the code into the console window, select all of it and press Ctrl+Enter/
Copy link to clipboard
Copied
Hi Behnam. This worked for me. Thanks. Now how do I turn off the highlighting. I can't seem to delete the script from the document.