Batch change link appearance?

Community Beginner ,
Aug 18, 2022 Aug 18, 2022

Copy link to clipboard

Copied

Is there a way to change the appearance of multiple links at one time? An overall setting/preference for link appearance? Specifically looking to change link type from 'visible rectangle' to 'invisible rectangle'. It's painstaking to edit every single link individually.

TOPICS
Edit and convert PDFs , How to

Views

40

Likes

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 , Aug 18, 2022 Aug 18, 2022

You can do it using this code:

 

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 = 0;
	}
}

Likes

Translate

Translate
Community Expert ,
Aug 18, 2022 Aug 18, 2022

Copy link to clipboard

Copied

You can do it using this code:

 

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 = 0;
	}
}

Likes

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 22, 2022 Aug 22, 2022

Copy link to clipboard

Copied

Thank you! I'm not very familiar with javascript (just enough to be able to run that or put it in an action). Would you be so kind as to help me understand what parts of that I need to edit to make it work for my document?

Likes

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 22, 2022 Aug 22, 2022

Copy link to clipboard

Copied

Don't edit anything. Run it as-is.

Likes

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 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

LATEST

Thank you!! Had to play with it a little, but that's user error - your answer was spot on and will save me a lot of time. What I actually ended up needing was to change the highlight style from "Invert" to "None", so replaced borderWidth with highlightMode, for anyone looking for this in the future:

 

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].highlightMode = "None";
	}
}



Likes

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