---
title: "Import data into PDF form using XFDF | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/forms/fill-form-fields/import-from-xfdf/"
md_url: "https://www.nutrient.io/guides/web/forms/fill-form-fields/import-from-xfdf.md"
last_updated: "2026-06-09T10:30:03.994Z"
description: "Use this guide to import form data into browser-authored PDF forms with XFDF when interoperability with external PDF tools is required."
---

# Import data into PDF forms using XFDF

With Nutrient Web SDK, it’s possible to set form field values in a document by importing them as XFDF.

Use this format when your workflow needs XFDF interoperability with third-party PDF tools.

If you need default internal persistence/syncing, [import from Instant JSON](https://www.nutrient.io/guides/web/forms/fill-form-fields/import-from-instant-json.md). For collaborative server-backed workflows, use [Document Engine](https://www.nutrient.io/guides/web/forms/submit-or-save/to-server-backed.md).

```js

const XFDF = `<?xml version="1.0" encoding="UTF-8"?>
	<xfdf xml:space="preserve" xmlns="http://ns.adobe.com/xfdf/">
		<annots></annots>
		<fields>
			<field name="Form field 1">
				<value>Text for form field 1</value>
			</field>
		</fields>
		<ids modified="8AFBEA0B224C4F2BAE69171EF4FCE3C0" original="CC968B2893024520A316261F10B8978C"/>
	</xfdf>
`

NutrientViewer.load({
	XFDF
});

```

The snippet above will prefill the form field named "Form Field 1" with the text "Text for form field 1".

You can also import form field values as XFDF using document operations, available with the Document Editor license component:

```js

const xfdf = `<?xml version="1.0" encoding="UTF-8"?>
	<xfdf xml:space="preserve" xmlns="http://ns.adobe.com/xfdf/">
		<annots></annots>
		<fields>
			<field name="Form field 1">
				<value>Text for form field 1</value>
			</field>
		</fields>
		<ids modified="8AFBEA0B224C4F2BAE69171EF4FCE3C0" original="CC968B2893024520A316261F10B8978C"/>
	</xfdf>
`

instance.applyOperations([
	{
		type: "applyXfdf",
		xfdf
	}
]);

```
---

## Related pages

- [Adding an image to a PDF form using JavaScript](/guides/web/forms/fill-form-fields/add-image.md)
- [Attach a file to a PDF form using JavaScript](/guides/web/forms/fill-form-fields/attach-a-file.md)
- [Dynamic font loading in PDF forms using Nutrient Web SDK](/guides/web/forms/fill-form-fields/dynamic-font-loading.md)
- [Detecting user inputs in PDF forms](/guides/web/forms/fill-form-fields/detect-user-input.md)
- [Headless form fill](/guides/web/forms/fill-form-fields/headless.md)
- [Import data into PDFs from a database](/guides/web/forms/fill-form-fields/import-from-database.md)
- [Import data into PDF forms using Instant JSON](/guides/web/forms/fill-form-fields/import-from-instant-json.md)
- [Import data into PDF form using Web SDK with Document Engine](/guides/web/forms/fill-form-fields/import-from-server-backed.md)
- [Customizing PDF form permissions](/guides/web/forms/fill-form-fields/permissions.md)
- [Fill PDF forms programmatically using JavaScript](/guides/web/forms/form-filling.md)
- [Fill PDF form fields using our JavaScript viewer UI](/guides/web/forms/fill-form-fields/using-the-ui.md)

