Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to highlight my hyperlinks?

New Here ,
Jul 02, 2020 Jul 02, 2020

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:

 

rubenper_0-1593679052869.png

 

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)

 

TOPICS
Edit and convert PDFs , How to
10.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 04, 2020 Jul 04, 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 Ac

...
Translate
LEGEND ,
Jul 02, 2020 Jul 02, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2020 Jul 04, 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 10, 2020 Jul 10, 2020

this worked great, thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 22, 2021 Jun 22, 2021

But this puts a border on it - what's the code to make it highlight on hover?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2021 Jun 22, 2021

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2021 Aug 01, 2021

Thanks, but can you please say how to run this code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2021 Aug 01, 2021

Press Ctrl+J, paste the code into the console window, select all of it and press Ctrl+Enter/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 26, 2022 Aug 26, 2022

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 23, 2024 May 23, 2024
LATEST

Thank you for writing this, I use your code rather regularly as I am checking pdf's that come from my technical writers. I'm just glad I dont have to use FrameMaker. I recently found an external link (website) that does not highlight after running the code. Do you know of another way to highlight external links as well? And/or, should that code already have highlighted my external links?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines