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

Problem changing all fields font size - properties field gray

Community Beginner ,
Feb 03, 2021 Feb 03, 2021

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
1.0K
Translate
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
1 ACCEPTED SOLUTION
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
}
}


Acrobate du PDF, InDesigner et Photoshopographe

View solution in original post

Translate
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

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.

Translate
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

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

Translate
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

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


Acrobate du PDF, InDesigner et Photoshopographe
Translate
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

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.

Translate
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

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

Translate
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

Make sure to select the full code before running it.

Translate
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
LATEST

That did it - thanks!

Translate
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