Skip to content
ComPDF
Guides

Form Properties

Use formsConfig.initAttribute to set default properties for each form type. These properties are automatically applied when creating new form controls.

TextField

json
{
  "formsConfig": {
    "initAttribute": {
      "textField": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2,
        "fontColor": "#000000",
        "fontSize": 20,
        "isBold": false,
        "isItalic": false,
        "alignment": "left",
        "multiline": true,
        "familyName": "Helvetica",
        "styleName": "Regular"
      }
    }
  }
}
FieldDescription
fillColorBackground fill color
borderColorBorder color
borderWidthBorder width
fontColorText color
fontSizeFont size
isBoldWhether bold
isItalicWhether italic
alignmentText alignment: "left", "center", "right"
multilineWhether multi-line input is supported
familyNameFont family name
styleNameFont style

CheckBox

json
{
  "formsConfig": {
    "initAttribute": {
      "checkBox": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2,
        "checkedColor": "#43474D",
        "isChecked": false,
        "checkedStyle": "check"
      }
    }
  }
}
FieldDescription
fillColorBackground color
borderColorBorder color
borderWidthBorder width
checkedColorChecked mark color
isCheckedDefault checked state
checkedStyleChecked style: "check", "circle", "cross", "diamond", "square", "star"

RadioButton

json
{
  "formsConfig": {
    "initAttribute": {
      "radioButton": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2,
        "checkedColor": "#43474D",
        "isChecked": false,
        "checkedStyle": "circle"
      }
    }
  }
}

Properties are similar to CheckBox. checkedStyle supports the same 6 styles.

ListBox

json
{
  "formsConfig": {
    "initAttribute": {
      "listBox": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2,
        "fontColor": "#000000",
        "fontSize": 20,
        "isBold": false,
        "isItalic": false,
        "familyName": "Helvetica",
        "styleName": "Regular"
      }
    }
  }
}

ComboBox

json
{
  "formsConfig": {
    "initAttribute": {
      "comboBox": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2,
        "fontColor": "#000000",
        "fontSize": 20,
        "isBold": false,
        "isItalic": false,
        "familyName": "Helvetica",
        "styleName": "Regular"
      }
    }
  }
}

Properties are identical to ListBox.

PushButton

json
{
  "formsConfig": {
    "initAttribute": {
      "pushButton": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2,
        "fontColor": "#000000",
        "fontSize": 20,
        "title": "Button",
        "isBold": false,
        "isItalic": false,
        "familyName": "Helvetica",
        "styleName": "Regular"
      }
    }
  }
}
FieldDescription
titleDefault button display text

SignaturesFields

json
{
  "formsConfig": {
    "initAttribute": {
      "signaturesFields": {
        "fillColor": "#DDE9FF",
        "borderColor": "#1460F3",
        "borderWidth": 2
      }
    }
  }
}

Signature fields only support basic appearance properties.

Property Editor Components

Each form type has a corresponding property editor Fragment:

Form TypeFragment Class
TextFieldCTextFieldStyleFragment
CheckBoxCCheckBoxStyleFragment
RadioButtonCRadioButtonStyleFragment
ListBoxCListBoxStyleFragment
ComboBoxCComboBoxStyleFragment
PushButtonCPushButtonStyleFragment
SignaturesFieldsCSignFieldStyleFragment

When using source code integration, you can extend or modify these Fragments to customize the form property panel UI.