Search code examples
javascriptapiannotationsacrobatfreetext

Setting transparent color as strokeColor in Acrobat JS API results in black border


my problem is that when I try to set transparent as strokeColor for FreeText annotation when adding one the resulting annotations has black border.

I try to code it like this:

this.addAnnot({ type: "FreeText", contents: "TEST", strokeColor: color.transparent, page: 0 });

Ane the result is:

Sample of the result

Is there any way to set transparent as border color for the annotation?


Solution

  • Add the undocumented property "intent" and set it to "FreeTextTypewriter". That property changes the way the on-page appearance gets generated.

    this.addAnnot({ type: "FreeText", contents: "TEST", page: 0 ,strokeColor: color.transparent, intent:"FreeTextTypewriter"});