Skip to main content
Participating Frequently
January 10, 2023
Answered

Universal change to Text Box Text properties?

  • January 10, 2023
  • 1 reply
  • 2696 views

I inherited a large file with a lot of text box comments of varying text sizes (see image as an example).

Is there a way to make a universal change to the text size in these text boxes, or does each one need to be adjusted manually?

Thanks for any help.

This topic has been closed for replies.
Correct answer try67

OK, then you can do it using this code:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i in annots) {
		var annot = annots[i];
		if (annot.type=="FreeText") {
			var annotContents = annot.richContents;
			for (var j in annotContents) annotContents[j].textSize = 20;
			annot.richContents = annotContents;
		}
	}
}

 

You can run it from the JS Console (for details, see: https://acrobatusers.com/tutorials/javascript_console), or even from an Action or a Custom Command, if you have Acrobat Pro.

1 reply

try67
Community Expert
Community Expert
January 10, 2023

It's possible to do using a script. What size do you want them to be?

Participating Frequently
January 10, 2023

Thanks for the response! In this case, I'd say 20 point.

 

(Not entirely sure how to use a script, for what it's worth)

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
January 11, 2023

OK, then you can do it using this code:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	for (var i in annots) {
		var annot = annots[i];
		if (annot.type=="FreeText") {
			var annotContents = annot.richContents;
			for (var j in annotContents) annotContents[j].textSize = 20;
			annot.richContents = annotContents;
		}
	}
}

 

You can run it from the JS Console (for details, see: https://acrobatusers.com/tutorials/javascript_console), or even from an Action or a Custom Command, if you have Acrobat Pro.