pdfrx_web
    Preparing search index...

    Function useFormFields

    • The document's AcroForm fields, reloaded whenever the document changes and whenever a value changes — from PdfFormFieldsState.setValue or from the user editing a field directly in the viewer.

      Returns PdfFormFieldsState

      The current form fields state and actions.

      const { fields, setValue } = useFormFields();
      return fields.map((f) =>
      f.type === 'checkBox' ? (
      <label key={f.name}>
      <input type="checkbox" checked={!!f.isChecked}
      onChange={(e) => setValue(f.name, e.target.checked)} />
      {f.name}
      </label>
      ) : (
      <input key={f.name} value={f.value}
      onChange={(e) => setValue(f.name, e.target.value)} />
      ),
      );