This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/forms/submit-or-save/to-custom.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Submit and save PDF form to custom destination on Android | Nutrient

Use SubmitFormAction to define a form submission to a custom destination. Provide these parameters when creating the action:

  • The destination URI
  • The form fields to include
  • The submission flags, including the format

The following example adds a button that defines an XFDF submission to a custom HTTP endpoint. Other formats include FDF, HTML, and the entire PDF.

override fun onDocumentLoaded(document: PdfDocument) {
super.onDocumentLoaded(document)
// Retrieve the form field to include in the submit form action.
val checkBoxField = document?.formProvider?.getFormFieldWithFullyQualifiedName("checkboxfield-1") ?: return
val rectFPushButtonFormConfiguration = RectF(30f, 350f, 120f, 260f)
val colorBitmap = Bitmap.createBitmap(500, 300, Bitmap.Config.ARGB_8888)
val canvas = Canvas(colorBitmap)
// Just use a red fill so the button is visible.
canvas.drawColor(Color.RED)
// Create the button form element (annotation).
val pushButtonFormConfiguration = PushButtonFormConfiguration.Builder(
0,
rectFPushButtonFormConfiguration,
colorBitmap
)
// Create the action and set the submission format to XFDF.
.setAction(SubmitFormAction(
"https://example.com/wherever-you-want-to-send-the-form",
mutableListOf(checkBoxField),
EnumSet.of(SubmitFormAction.SubmitFormActionFlag.XFDF)))
.build()
// Ask Nutrient to create the form field and add it to the document. This will also add the form element to the document.
// The `fullyQualifiedName` must not be the same as an existing form field, but otherwise can be whatever you like.
document?.formProvider?.addFormElementToPage("pushbuttonfield-1", pushButtonFormConfiguration)
}

Nutrient Android SDK can add submission actions for other readers, but it doesn’t execute them by default. To implement submission, refer to the customizing the submission method guide.