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

Set multiline option on hierarchic named fields impossible!

Community Expert ,
Sep 28, 2019 Sep 28, 2019

Copy link to clipboard

Copied

Using javascript , it's possible to set all the Appearance options to multiple text fields using hierarchic names. But I noticed that I can't do this for any of the General (readonly) or Options options (multiline true/false or defaultValue). I'm trying to have a functions that create three text fields with specific attributes. Here my code... Maybe I'm approaching it the wrong way and shall create one field and duplicate it using javascript. But I don't know how (yet! 🙂 )

addField("jv.n", "text", this.pageNum, [18, 18, 582, 162]);
addField("jv.m", "text", this.pageNum, [18, 186, 582, 330]);
addField("jv.0", "text", this.pageNum, [18, 354, 582, 498]);
var fNa = ("jv");
    var f = this.getField(fNa);
f.textSize = 10;
f.textFont = "Courier";
f.textColor = color.black;
f.fillColor = ["G", 0.9];
f.display = display.visible;
f.multiline = true;
f.doNotScroll = false;
f.doNotSpellCheck = true;
f.readonly = true;
f.defaultValue = "JavaScript - description: ";
this.resetForm("jv");




TOPICS
Acrobat SDK and JavaScript

Views

539

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
LEGEND ,
Oct 01, 2019 Oct 01, 2019

Copy link to clipboard

Copied

You should be able to get the individual fields and set the properties you want. E.g.,

 

var f1 = addField("jv.n", ...);

f1.multiline = true;

// etc.

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 ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

LATEST

Georges, I have try it with var f1 = addField ("jv.n"...) for all three but only the last one get it. I ended up using the same name for the three fields (I will manually edit them anyways).

 

var f = addField("jv", "text", this.pageNum, [18, 18, 582, 162]);
var f = addField("jv", "text", this.pageNum, [18, 186, 582, 330]);
var f = addField("jv", "text", this.pageNum, [18, 354, 582, 498]);
f.textSize = 10;
f.textFont = "Courier";
f.textColor = color.black;
f.fillColor = ["G", 0.9];
f.display = display.visible;
f.multiline = true;
f.doNotScroll = false;
f.doNotSpellCheck = true;
f.readonly = true;
f.defaultValue = "JavaScript - description: ";
this.resetForm("jv");

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