textField

fun textField(name: String, width: Dp, height: Dp = Dp(24f), value: String = "", multiline: Boolean = false)

Appends an interactive AcroForm text input field — a fillable box in the produced PDF.

Per-platform behaviour:

  • JVM / Desktop (PdfBox) — a real interactive PDTextField the user can type into, plus the static visual box.

  • Android / iOS — visual-only: a bordered light-gray box rendered with value inside, but not editable (the underlying PDF generators expose no AcroForm API). The field still reads correctly as a form slot when the document is printed or viewed.

Field-name collisions are resolved by the backend by appending a numeric suffix (-2, -3, …) so two fields named the same don't clobber each other's value.

Parameters

name

AcroForm field name (used to read the value back).

width

rendered width of the field box.

height

rendered height of the field box.

value

initial text content.

multiline

whether the field accepts multiple lines.