Fill PDF forms in Flutter
Nutrient Flutter SDK enables you to fill form fields programmatically. Each form field has a fully qualified name that identifies a specific form field object before you fill it.
Get the fully qualified name of a form field
The following example gets the fully qualified name of the first form field on the first page of a document:
final fields = await controller.document.forms.getFormFields();// Get the fully qualified name of the first form field.final String? formFieldName = fields.first.fullyQualifiedName;Fill the value of a form field
The following example fills a form field with the fully qualified name formFieldName. It also sets two radio buttons with the fully qualified names radioFieldName_0 and radioFieldName_1:
final forms = controller.document.forms;
await forms.setFormFieldValue('Dummy Form Field Value', 'formFieldName');
// For radio buttons and checkboxes, use `selected` and `deselected`.await forms.setFormFieldValue('selected', 'radioFieldName_0');await forms.setFormFieldValue('deselected', 'radioFieldName_1');