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

change font & font size in all text fields

Participant ,
Jul 19, 2016 Jul 19, 2016

hi, i want to change font & font size in all text fields. I have tried bellow code but it change the font size but didn't change the font. can u pls help me. thanks..

font - Courier New

font size - 10

// Loop throught the fields in the document

for (var i = 0; i < numFields; i++) {

              // Get a reference to the current field

var f = getField(getNthFieldName(i));

              // Change the properties of certain types of fields

switch(f.type) {

  case "text":

f.textFont = font. Courier New; 

f.textSize = 10; 

}

}

TOPICS
Acrobat SDK and JavaScript , Windows
12.9K
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

correct answers 1 Correct answer

LEGEND , Jul 19, 2016 Jul 19, 2016

Do you have a good reason for wanting to use Courier New instead of the built-in Courier font? In any case, you need change that one line to:

// Use the built-in Courier font

f.textFont = font.Cour;

- or -

// Use Courier New

f.textFont = "CourierNew";

Translate
LEGEND ,
Jul 19, 2016 Jul 19, 2016

Do you have a good reason for wanting to use Courier New instead of the built-in Courier font? In any case, you need change that one line to:

// Use the built-in Courier font

f.textFont = font.Cour;

- or -

// Use Courier New

f.textFont = "CourierNew";

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
New Here ,
Jan 09, 2019 Jan 09, 2019

Can't font size be changed with out code for those who don't know?

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 ,
Jan 09, 2019 Jan 09, 2019
LATEST

Sure. You can select multiple fields at once, then right-click one of them, go to Properties and change it under the Appearance tab.

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