> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/forms/import-export.md).

# Importing & exporting data from PDF forms

Discover how to efficiently import & export data from PDF forms using XFDF. Learn how to save & load form field data effortlessly. Explore the XFDF file format for seamless importing & exporting of an

## Importing and exporting

All form data, including field values and widget appearances, can be saved and loaded the same way as annotations through XFDF data. Please see our guides on [XFDF](/web/annotation/xfdf.md) and [importing/exporting annotations](/web/annotation/import-export.md) to learn more.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
// Importing XFDF into WebViewer ...
const formXML = ``;
await instance.Core.annotationManager.importAnnotations(formXML);

// Exporting XFDF from WebViewer. Copies to browser clipboard.
copy(await instance.Core.annotationManager.exportAnnotations());
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Form fields XML sample

A full sample of form fields in XML format is shown below, and can be copied into the sample code above allowing it to be loaded into WebViewer with [annotationManager.importAnnotations](https://sdk.apryse.com/api/web/Core.AnnotationManager.html#importAnnotations__anchor).

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
	<pdf-info xmlns="http://www.pdftron.com/pdfinfo" version="2" import-version="4">
		<ffield type="Sig" name="SignatureFormField 1" />
		<ffield type="Tx" name="TextFormField 2">
			<font name="Helvetica" size="12" />
		</ffield>
		<ffield type="Btn" name="CheckBoxFormField 3">
			<font name="Helvetica" />
		</ffield>
		<ffield type="Ch" name="ListBoxFormField 5" flags="MultiSelect">
			<font name="Helvetica" size="12" />
			<options>
				<option display-value="Option 1" value="1" />
				<option display-value="Option 2" value="2" />
				<option display-value="Option 3" value="3" />
			</options>
		</ffield>
		<ffield type="Ch" name="ComboBoxFormField 6" flags="Combo MultiSelect">
			<font name="Helvetica" size="12" />
			<options>
				<option display-value="Test 1" value="1" />
				<option display-value="Test 2" value="2" />
				<option display-value="Test 3" value="3" />
			</options>
		</ffield>
		<ffield type="Btn" name="Radio Button 1" flags="Radio NoToggleToOff">
			<font name="Helvetica" />
		</ffield>
		<widget field="SignatureFormField 1" name="f4ee4886-b110-ca41-bc36-a6186664b7ec" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="57.22" x2="237.22" y1="701.65" y2="741.65" />
			<border style="solid" />
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false","trn-signature-type":"fullSignature"}' />
		</widget>
		<widget field="TextFormField 2" name="1fb708d5-45ef-5c72-673d-08472833c3e6" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="57.22" x2="257.22" y1="640.886" y2="680.886" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
		<widget appearance="Off" field="CheckBoxFormField 3" name="b36c2151-5b30-63a1-c5fb-2712921e9cd0" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="57.22" x2="77.22" y1="600.122" y2="620.122" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<appearances>
				<aappearance name="Off" />
				<aappearance name="Yes" />
			</appearances>
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
		<widget appearance="Off" index="1" field="Radio Button 1" name="794ab785-de71-e2f5-d2d0-6d2bdf313d5a" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="57.22" x2="77.22" y1="559.358" y2="579.358" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<appearances>
				<aappearance name="Off" />
				<aappearance name="794ab785-de71-e2f5-d2d0-6d2bdf313d5a" />
			</appearances>
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
		<widget appearance="Off" field="ListBoxFormField 5" name="894fd363-660d-2da4-6d70-684e5d79f80a" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="57.22" x2="207.22" y1="388.594" y2="538.594" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<appearances>
				<aappearance name="Off" />
				<aappearance name="Yes" />
			</appearances>
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
		<widget field="ComboBoxFormField 6" name="b67d86cb-6d31-dda3-6191-975360cc3ed6" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="57.22" x2="257.22" y1="327.83" y2="367.83" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
		<widget appearance="Off" field="Radio Button 1" name="6cf0280b-9f11-6bbd-5edf-0add532c1e6b" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="90.22" x2="110.22" y1="558.8935" y2="578.8935" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<appearances>
				<aappearance name="Off" />
				<aappearance name="6cf0280b-9f11-6bbd-5edf-0add532c1e6b" />
			</appearances>
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
		<widget appearance="Off" index="2" field="Radio Button 1" name="b55fff84-8283-493c-9569-a6f2017a2b80" modified-date="D:20241022102259-07'00'" page="1">
			<rect x1="123.22" x2="143.22" y1="558.429" y2="578.429" />
			<border style="solid" />
			<background-color r="255" g="255" b="255" />
			<appearances>
				<aappearance name="Off" />
				<aappearance name="b55fff84-8283-493c-9569-a6f2017a2b80" />
			</appearances>
			<trn-custom-data bytes='{"trn-form-field-show-indicator":"false"}' />
		</widget>
	</pdf-info>
	<fields>
		<field name="SignatureFormField 1">
			<value></value>
		</field>
		<field name="TextFormField 2">
			<value>Test</value>
		</field>
		<field name="CheckBoxFormField 3">
			<value>Off</value>
		</field>
		<field name="ListBoxFormField 5">
			<value>3</value>
		</field>
		<field name="ComboBoxFormField 6">
			<value></value>
		</field>
		<field name="Radio Button 1">
			<value></value>
		</field>
	</fields>
	<annots />
	<pages>
		<defmtx matrix="1,0,0,-1,0,792" />
	</pages>
</xfdf>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Learn more

[A short introduction to XFDF file format](/web/annotation/xfdf.md) An introduction to XFDF file format

[Importing and exporting annotations](/web/annotation/import-export.md) To import and export annotation and forms data through XFDF data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/forms/import-export.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
