Copy link to clipboard
Copied
When editing a PDF and needing to change the text style throughout all text box fields is there a way that I can select every single field or automatcially set the font size and style. I have not been able to figure this out and it consumes a lot of time to have to select each individual text field/highlight and select the ones that are on the current page and edit them that way. It would save me so much time if I could just edit them all at once.
Copy link to clipboard
Copied
Depends what kind of "text fields" you're referring to. Are these actual form fields? If so then it can be quite easily done with a script.
Also free-text annotations can be edited using a script, but it's more complex. If you're referring to static content on the page then it's not possible, though.
Copy link to clipboard
Copied
They are text fields that I am creating in the document.
Copy link to clipboard
Copied
OK. So let's say you want to set them all to font-size 12. You can run this code from the console:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (f.type=="text") {
f.textSize = 12;
}
}
Copy link to clipboard
Copied
Okay so I want all the font to be Courier New Bold size 9. Is that possible with the code you posted?
Copy link to clipboard
Copied
Yes, I think so check out the JS API Reference for available properties.
Copy link to clipboard
Copied
Add this line of code after line 5 of the code above:
f.textFont = "CourierNew,Bold";
If you're interested, by the way, I've developed a tool that allows you to easily perform such tasks without having to know how to write scripts.
You can purchase it from here: Custom-made Adobe Scripts: Acrobat -- Mass Edit Fields Properties
Copy link to clipboard
Copied
I have no idea what JS API is. Sorry...I am new to adobe.
Copy link to clipboard
Copied
Solving this is really a task for a programmer, I fear. This is the problem with saying something can "easily" be done in a script. If you are adventurous you can find where that code is setting point size and set it to 9 instead, but you won't get there with just copy/paste...
Copy link to clipboard
Copied
I see. I don't even know how to get to or find codes. I was just hoping there would be a way so it would save me a lot of time. I really appreciate all your help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now