setting type size in multiple text fields?
Copy link to clipboard
Copied
I am SO close to being finished with these documents but I can't find the answer to a couple of things.
I have a form nicely formatted with nice text fields. The type on the pages is Cambria, but I want to change ALL the form text fields to 12 point Helvetica. I can't figure out a way to do it.
I'm using a Mac and figured out that if I select all the text fields, select the Form icon, press the Control key, and click on a text field it will bring up a menu that includes Properties. This allows me to change just one text field at a time.
Surely there's a better way??? tia
Copy link to clipboard
Copied
If you select multiple fields (of the same type!) and then right-click one of them and change its appearance properties it will be applied to all the selected fields. You can also do it using a script, such as this one:
for (var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f==null) continue;
if (f.type=="text") {
f.textFont = font.Helv;
f.textSize = 12;
}
}
You can run it from the JS Console, a button or even use it to create a Custom Command, which will allow you to process all the (text) fields in the current file with a single click.
Copy link to clipboard
Copied
Thanks, but I'm using a Mac with a track pad, and I don't know what a JS Console is.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
sigh . . .
I finally figured out how to get to the console (thanks), copied your code, and "ran" it using Command + Enter. Here's what I got:
SyntaxError: syntax error 1:Console:Exec undefined
There has to be an easier way to do this!
Copy link to clipboard
Copied
Did you edit the code I provided in any way? There's no such error in that code.
Did you try to attach it to a Custom Command, as I suggested?
Copy link to clipboard
Copied
Also, did you select the full code before running it?
Copy link to clipboard
Copied
I guess I didn't explain that I know nothing!! Was I supposed to select all the code? I did nothing to the code but copy it from your message and paste it into the console window. How would I attach anything to anything like a custom command.
I appreciate your wisdom and counsel, but I am but a grasshopper lost in the weeds!
Copy link to clipboard
Copied
I wasn't aware that I needed to learn coding in order to use Acrobat. That probably explains why I'm constantly having problems like this.
Copy link to clipboard
Copied
Hmm, this JS console business may have worked, despite the syntax error. When I click on Forms, then double click on the individual text field it shows up as 12 pt Helvetica, which is what I wanted. On every line!!
So I'm going to call this a win and I thank you greatly!!!
Copy link to clipboard
Copied
- You don't need to learn coding to be able to use Acrobat, but it helps if you want to do things more efficiently. I also explained how to do it manually.
- If you didn't select all the code first then it didn't run and did not edit your fields.
- Re custom commands, see here: https://blog.adobe.com/en/publish/2016/03/24/hidden-gems-in-acrobat-dc-create-custom-commands
Or here: http://khkonsulting.com/2015/04/create-custom-tools-in-adobe-acrobat-dc-pro/

