This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/forms/create-edit-and-remove/disable-editing.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Disable PDF form editing on Android | Nutrient SDK

You can disable modification of a specific form field by calling setReadOnly(true) on the FormField and call setReadOnly(false) later to make it editable again.

document.formProvider
.getFormFieldWithFullyQualifiedNameAsync("Text Field 1")
.subscribe { formField ->
formField.setReadOnly(true)
}

Registered OnFormFieldUpdatedListeners are notified when the field’s read-only state changes.

The synchronous getFormFieldWithFullyQualifiedName() API may block and shouldn’t be called on the main thread. Use the async API in UI flows, or call the synchronous API from a background thread.

If you need to prevent filling only a specific widget annotation, set the widget annotation’s AnnotationFlags.LOCKEDCONTENTS flag. The widget annotation’s READONLY flag doesn’t prevent form filling on Android. For more information, refer to the annotation flags guide.

Disabling custom values in combo boxes

A combo box can accept values that aren’t in its option list only if the PDF form field is marked as editable. Use ComboBoxFormElement#isEditable() to check whether that custom text input is enabled for the field.

To prevent custom values, change the form field definition so the combo box isn’t editable. If you need to block all user edits to the field, make the corresponding widget annotation read-only with AnnotationFlags.READONLY.

Disabling all form interactions

You can disable all form interactions and modifications using formEditingEnabled(false):

val builder = PdfActivityConfiguration.Builder(context)
builder.formEditingEnabled(false)