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

Changing font by javascript

Explorer ,
Nov 18, 2023 Nov 18, 2023

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

Use this: "Calibri,Bold"

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

Use this: "Calibri,Bold"

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

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

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