Add border to a form field while I create it

Product: WebViewer

Product Version: latest

Please give a brief summary of your issue:
Add border to a form field while I create it

Please describe your issue and provide steps to reproduce it:

I am trying to create a form field and while creating I want to create with a specified border can some please provide me the right code to add here.

const { annotationManager, Annotations } = instance.Core;
const { WidgetFlags } = Annotations;

  // set flags for multiline and required
  const flags = new WidgetFlags();
  flags.set("Multiline", true);
  flags.set("Required", true);

  // create a form field
  const field = new Annotations.Forms.Field(formFieldName, {
    type: "Tx",
    defaultValue: "",

  // create a widget annotation
  const widgetAnnot = new Annotations.TextWidgetAnnotation(field);
  // set position and size
  widgetAnnot.Color = "grey";
  widgetAnnot.PageNumber = 1;
  widgetAnnot.X = 100;
  widgetAnnot.Y = 100;
  widgetAnnot.Width = 50;
  widgetAnnot.Height = 20;

  //add the form field and widget annotation
  // Annotations.WidgetAnnotation.getCustomStyles = customStyles;

Please provide a link to a minimal sample where the issue is reproducible:

Hi Indranath
I have tried your code. It does have border. To better assist you, could you give me more detail like what kind of border do you want??