public class

FormProvider

extends Object
java.lang.Object
   ↳ com.pspdfkit.api.forms.FormProvider

Class Overview

Handles all form related operations on the owning document. Retrieve it with getFormProvider().

Summary

Public Constructors
FormProvider(NativeDocument nativeDocument)
Public Methods
JSONObject getFormFieldValuesJson()
Returns a JSON object that contains all form fields currently loaded and maps to their values.
void setFormFieldValuesJson(JSONObject formFieldValues)
Updates the values of form fields.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FormProvider (NativeDocument nativeDocument)

Public Methods

public JSONObject getFormFieldValuesJson ()

Returns a JSON object that contains all form fields currently loaded and maps to their values.

Each object of the JSON Object will hold a key which is the unique name of the form field (often referred to as fully qualified name) with the value being of json type null, string, or Array.

{ textBox: "Some value", comboBox: ["Off"], anotherField: null }

Returns
  • A JSON Object holding the current form field key values pairs.

public void setFormFieldValuesJson (JSONObject formFieldValues)

Updates the values of form fields. It's possible to update multiple form fields at once.

Each object of the JSON Object must hold a key which is the unique name of the form field (often referred to as fully qualified name) with the value being of json type `null`, `string`, or `Array`. A `null` value will reset the form field to either `null`, or it's default value if available.

{ textBox: "Some value", comboBox: ["Off"], anotherField: null }

Parameters
formFieldValues A JSON Object holding the form field key values pairs to set.