• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

649

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

Community Expert , 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
}
}

Votes

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.

Votes

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 Expert ,
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.

Votes

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 Expert ,
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
}
}

Votes

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.

Votes

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

Votes

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

Copy link to clipboard

Copied

Make sure to select the full code before running it.

Votes

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

LATEST

That did it - thanks!

Votes

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