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

Annotation - set font not working

New Here ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

Acrobat DC on PC or mac.  I am adding an annotation to a page via a Custom Command.  The text color, size, and alignment all are working.  However, the typeface is always Helvetica.  I have tried font.Times , font.Cour, "Times", "Courier" as the argument after textFont:    Any suggestions?

var annot = this.addAnnot(

     page: msgOnThisPage,

     type: "FreeText",

     rect: [36,36, 612-36,72],

     textFont: font.Times,

     strokeColor: color.white

}

); 

spans[0] = new Object();

spans[0].text = theMessage[0];

spans[0].textColor = color.black;

spans[0].textSize = 14;

spans[0].fill = "invisible";  // no background color

spans[0].alignment = "center";

annot.richContents = spans;

   

TOPICS
Acrobat SDK and JavaScript , Windows

Views

384

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 , Jul 10, 2018 Jul 10, 2018

Add this line:

spans[0].fontFamily = ["Times"];

By the way, there's no "fill" property to a Span object. You should remove that line.

Votes

Translate

Translate
Community Expert ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

Add this line:

spans[0].fontFamily = ["Times"];

By the way, there's no "fill" property to a Span object. You should remove that line.

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 ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

Instead of "fill" you can use the fillColor property of the annotation itself. And the value should be "color. transparent" (without the quotes).

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
New Here ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

LATEST

Thanks for the help.

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