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

Identifying all hidden hyperlinks in a PDF, using Acrobat Pro for Mac

Explorer ,
Aug 12, 2023 Aug 12, 2023

I'm using the following version of Acrobat Pro on Mac OS Monterey v. 12.6.8:

A3164000858s0_3-1691901369996.png

I have Word documents containing hidden active hyperlinks, by which I mean active hyperlinks formatted as normal text.  When those are converted to PDF, the hyperlinks remain both active and hidden.

 

Adobe does offer an easy way to inactivate all of them:  

Tools → Edit PDF → Link → Remove Web Links

However, before I do that, I'd like a way to identify all the hidden hyperlinks in the document.  Adobe offers a way to do that as well, but it's limited to processing one page at a time:

Tools → Edit PDF → Link → View Web Links

This is what it shows (I blacked out the links).

A3164000858s0_2-1691901240696.png

Unfortunately, as this process needs to be repeated for each page, it's too laborious for large documents.  

Thus is there a way to do either of the following?:
1) With a single action, generate a list of all the hyperlinks in your document as a whole.  
or:
2) With a single action, format all the hyperlinks in your document in a distinctive way, making them easy to spot as you scroll through it.

 

Yes, another solution would be to remove them from the Word documents before they are converted to PDF.  Yet because of our workflow (where we are assembling many Word source docs into a single PDF), having an ability to do a final check in Acrobat would be a great convenience.  

TOPICS
Edit and convert PDFs , How to , PDF
6.8K
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
1 ACCEPTED SOLUTION
Community Expert ,
Aug 13, 2023 Aug 13, 2023

For the latter you can use this code (you run it from the JS Console, for example):

 

 

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].borderWidth = 1;
		links[i].borderColor = color.blue;
	}
}

 

 

The former will require a more complex tool, as I said. If you're interested in hiring a professional to create it for you, feel free to contact me privately via PM to discuss it further.

View solution in original post

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 13, 2023 Aug 13, 2023

1) Kind of. You can access all the links in the file using a script, but it can't know to where they are pointing. This will require either a plugin or a stand-alone tool.

2) Yes, this can be done using a script. It can change the border color of all links to blue, for example.

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
Explorer ,
Aug 13, 2023 Aug 13, 2023

Thanks try67.  How would I go about making those scripts?

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 13, 2023 Aug 13, 2023

For the latter you can use this code (you run it from the JS Console, for example):

 

 

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].borderWidth = 1;
		links[i].borderColor = color.blue;
	}
}

 

 

The former will require a more complex tool, as I said. If you're interested in hiring a professional to create it for you, feel free to contact me privately via PM to discuss it further.

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
Explorer ,
Aug 13, 2023 Aug 13, 2023

Thanks again!  I'm not in a position to be able to hire anyone, but I will try out your highlighting code. I've never used JS Console, but I should be able to figure it out....I found this, which should provide a good start:   
https://acrobatusers.com/tutorials/javascript_console/

Will your code work equally well in Adobe for Windows?

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 13, 2023 Aug 13, 2023

Yes, it will work in both platforms.

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
Explorer ,
Aug 13, 2023 Aug 13, 2023

It works--very cool!  How do I save it as a permanent macro that I can use with any document--say something I could add as a button to the ribbon?

I looked through some of the Adobe Java resources, and wasn't able to find anything.  Of course, if you'd prefer, I could post that as a separate question.

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
Explorer ,
Aug 13, 2023 Aug 13, 2023
LATEST

Never mind, I decided it was more appropriate to post this as a separate question:
https://community.adobe.com/t5/acrobat-discussions/how-do-i-turn-a-javascript-in-the-js-console-into...

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