Link
Skip to main content

Separate form data from the form

Note: This functionality is limited to AcroForm PDF file conversions only.

Data Decoupling

By default, FormVu takes the current filled values of form fields, and places them into the output HTML5. However, you may want to only have the template of the form, without any of the fields set. The decoupleFormData setting is for this use-case.

Rather than using the current filled values of the form fields, they will still output the field in the HTML5 without any value set, and place the current values into a new JSON file, formdata.json.

If a form field has the no-export flag set, the field will not be included in the output JSON.

Example Output

formdata.json is output as a JSON array, filled with JSON objects. Each JSON object, contains the information for a form field that was converted.

Details in this object will include:

  • objref = The PDF object reference of the form field
  • fieldName = The name of the form field
  • value = the value of the form field
  • inputType = the type of the form field (text, checkbox, etc.)

An example would look like the following:

[
    {
        "objref": "10 0 R",
        "fieldName": "FormFieldName",
        "value": "ValueOfFormField",
        "inputType": "text"
    }
]

Export with Empty values

If you require form fields that do not have a value set (or have been set to an empty string), you can use the decoupleEmptyValues setting. It will output in the same format, but will have the “value” field left as an empty string “”.

Import formdata via FormVuAPI

In addition to being able to parse the data in formdata.json for your own purposes, if you want to populate the converted HTML5 with the values, we have also provided a new function in the FormVuAPI.

// formdata can either be a String or a JS Object
FormVuAPI.insertFormValues(formdata);

// If you want the form to be reset before importing the data, you can do the following:
FormVuAPI.insertFormValues(formdata, true);

What's included in your FormVu trial?

  • Access to download the SDK and run it locally.
  • Access to the cloud trial to convert documents in the IDR cloud.
  • Access to the Docker image to set up your own trial server in the cloud.
  • Communicate with IDR developers to ask questions & get expert advice.
  • Plenty of time to experiment and build a proof of concept.
  • Over 100 articles to help you get started and learn about FormVu.
  • An exceptional PDF Form to HTML converter that took over 20 years to build!

Learn more about FormVu

Start Your Free Trial