Extract data from PDF form fields in React Native

PSPDFKit for React Native allows you to extract data from form fields programmatically. Each form field has a fully qualified name, which is used to identify and retrieve a specific form field object before extracting its data.

Getting the fully qualified name of a form field

The example below shows how to obtain the fully qualified name of the first form field on the first page of a document:

const annotations = await this.pdfRef.current?.getDocument().getAnnotationsForPage(0);
const firstFormFieldName = annotations[0]['formFieldName'];

Getting the data from a form field

The example below shows how to get the value of a form field:

let lastName = await Pspdfkit.getFormFieldValue('formFieldName');