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

Changing font by javascript

Explorer ,
Nov 18, 2023 Nov 18, 2023

Copy link to clipboard

Copied

Please!! .... I need help.  I 'm so stuck . I've tried but I can't get a font to change within my fields by javascript. It always change to Calibri not Calibri Bold. I have used the  code "console.println(this.getField("Field1").textFont);" to konw the internal name of the Calibri Bold font. But it shows only Calibri for the "Field1" that has been set to "Calibri Bold" manualy.

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

    var f = this.getField(this.getNthFieldName(i));

    if (f.type == "text") {
        f.textFont = "Calibri Bold";
        f.textSize = 12;
    }
}

 

TOPICS
JavaScript , PDF forms

Views

206

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 , Nov 18, 2023 Nov 18, 2023

Use this: "Calibri,Bold"

Votes

Translate

Translate
Community Expert ,
Nov 18, 2023 Nov 18, 2023

Copy link to clipboard

Copied

Use this: "Calibri,Bold"

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
Explorer ,
Nov 18, 2023 Nov 18, 2023

Copy link to clipboard

Copied

LATEST

You are really amazing...............

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