Skip to main content
Participating Frequently
January 10, 2023
解決済み

Universal change to Text Box Text properties?

  • January 10, 2023
  • 返信数 1.
  • 2697 ビュー

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.

このトピックへの返信は締め切られました。
解決に役立った回答 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

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 Expert解決!
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.