Skip to main content
Participant
July 2, 2020
Answered

How to highlight my hyperlinks?

  • July 2, 2020
  • 2 replies
  • 10842 views

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)

 

This topic has been closed for replies.
Correct answer try67

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...

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 4, 2020

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...

rubenperAuthor
Participant
July 10, 2020

this worked great, thanks

Legend
July 2, 2020

Highlight in the original document. Too late once it’s a PDF.