Problem changing all fields font size - properties field gray

Community Beginner ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

I've followed other posts' instructions for changing all fields' font sizes, but when I go to the properties of the first selected field, the Font Size property containing the word 'Auto' is gray.  How can I activate that field?

TOPICS
Edit and convert PDFs, How to, PDF forms

Views

73

Likes

translate

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

Adobe Community Professional , Feb 03, 2021 Feb 03, 2021
There is a much faster method. Copy-paste this script in the JS Console, select all, and hit the Enter key (Enter is not Return).   for (var i=0; i<this.numFields; i++) {var oFld = this.getField(this.getNthFieldName(i));if (oFld.type == "text") {oFld.textSize = 12; // text size}}

Likes

translate

Translate

Translate
Community Beginner ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

After rereading my post, I want to make sure it is clear:  The Font Size property from which I should be able to choose a font size number is disabled, with the word 'Auto' in it.  I cannot find a way to enable that field.  If I only select a single PDF field, it's Font Size property is enabled, and I can select the font size I want.  I was hoping to be able to make a single change that would affect all 50-60 fields on the PDF.

Likes

translate

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
Most Valuable Participant ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

Make sure you're only selecting fields of the same type, then try again.

Likes

translate

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
Adobe Community Professional ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

There is a much faster method.

Copy-paste this script in the JS Console, select all, and hit the Enter key (Enter is not Return).

 

for (var i=0; i<this.numFields; i++) {
var oFld = this.getField(this.getNthFieldName(i));
if (oFld.type == "text") {
oFld.textSize = 12; // text size
}
}

Likes

translate

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 ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

I enabled the JS Console and pasted in the code, but pressing the Enter key does nothing, and there's no enter button or function in the console that I can find.

Likes

translate

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 ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

OK, I did some digging and found out how to execute the code.  Here's what I'm getting:

 

for (var i=0; i<this.numFields; i++)
{
var oFld = this.getField(this.getNthFieldName(i));
if (oFld.type == "text")
{
oFld.textSize = 12;
}
}

SyntaxError: syntax error
2:Console:Exec
undefined

Likes

translate

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
Most Valuable Participant ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

Make sure to select the full code before running it.

Likes

translate

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 ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

That did it - thanks!

Likes

translate

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