Copy link to clipboard
Copied
I'm using the following version of Acrobat Pro on Mac OS Monterey v. 12.6.8:
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).
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks try67. How would I go about making those scripts?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Yes, it will work in both platforms.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now