How to add signature fields to PDFs on Android

A form field is a model representation of a visual form element in a document. To enable form field creation, Nutrient exposes a handy set of configuration builders that make the entire process smooth. For more information on the difference between a form field and a form element, see our introduction to forms guide.

The minimum amount of information required for the creation of a signature form configuration is the page index and the annotation bounding box that will contain the signature form element. Once built, it can be added to a document using FormProvider#addFormElementToPage:

val page = 0
val rectFSignatureFormConfiguration = RectF(
30f, // left
190f, // top
200f, // right
160f // bottom
)
val signatureFormConfiguration = SignatureFormConfiguration.Builder(page, rectFSignatureFormConfiguration)
.build()
val signatureFormField = document.formProvider.addFormElementToPage("signaturefield-1", signatureFormConfiguration)

You can add any kind of form field to a document, apart from signature form fields. Check out the Android documentation for more info about the Forms API.