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

How to highlight my hyperlinks?

New Here ,
Jul 02, 2020 Jul 02, 2020

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:

 

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

Views

6.8K

Translate

Translate

Report

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

...

Votes

Translate

Translate
LEGEND ,
Jul 02, 2020 Jul 02, 2020

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

this worked great, thanks

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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. 

Votes

Translate

Translate

Report

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