Fill PDF Forms on the Go with Import and Export Form Data Support in Xamarin PDF Viewer
Tags: android, ios, csharp, xamarin
Published: 2020-03-10 03:26:07

---
title: Fill PDF Forms on the Go with Import and Export Form Data Support in Xamarin PDF Viewer
published: true
date: 2020-02-24 12:28:05 UTC
tags: android, ios, csharp, xamarin
canonical_url: https://www.syncfusion.com/blogs/post/fill-pdf-forms-with-import-and-export-form-data-in-xamarin-pdf-viewer.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/22zjnrlaneesyu1z0yqc.png
---

Are you frequently filling PDF forms in your Xamarin mobile application? Are you annoyed at entering basic details like your name, email address, and phone number again and again? Then here is a solution to your problem.

The [Syncfusion PDF Viewer control for Xamarin](https://www.syncfusion.com/xamarin-ui-controls/xamarin-pdf-viewer) lets you export and import form data in PDF documents so you can fill PDF forms with ease.

PDF Viewer provides options to export and import annotations and form data in the following formats:

- **_XFDF_**
- **_FDF_**
- **_JSON_**
- **_XML_**

## Export and import form data in PDF documents

The export and import form data functionality helps you reuse older form field data in updating newer PDF documents.

Consider a case in which we have an older PDF document containing a person’s information with the form fields Name, Gender, DOB, and Address in it. Now, our requirement is to add a new form field to maintain the person’s signature, too. Instead of filling in data for all the form fields in the updated document, we can use the export and import form data functionality to fill in the data for the known fields. This will reduce the effort and time consumed.

The following code example demonstrates how to export and import form data in a PDF document.

_Exporting form data_

```csharp
//Export form data to "fdf" data format.
Stream fdfStreamToSave = pdfViewerControl.ExportFormData(DataFormat.Fdf, "PdfFileName.fdf");
```

_Importing form data_

```csharp
//Import form data from "fdf" data format.
Stream fdfStreamToImport = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("SampleDefaultNamespace.Assets.PdfFileName.fdf");
pdfViewerControl.ImportFormData(fdfStreamToImport, DataFormat.Fdf);
```

### Export and import form data—sample project

You can find the sample project explaining the exporting and importing form data functions in this [GitHub](https://github.com/SyncfusionExamples/Export-and-import-data-using-xamarin-pdf-viewer/tree/master/Export-and-import-form-data) location. In this sample, initially an older form data document will be loaded. By clicking the **Export** button in the top toolbar, the existing form data will be exported, and an updated document will be loaded. Once you import the form data by clicking the **Import** option in the same toolbar, you’ll see that the older form data values get transferred to the new, updated document. The following GIF image illustrates this. ![](https://www.syncfusion.com/blogs/wp-content/uploads/2020/02/Export-and-import-PDF-form-data.gif)

To learn more about exporting and importing form data, refer to our documentation page, [Importing and exporting form data](https://help.syncfusion.com/xamarin/pdf-viewer/importing-and-exporting-data#importing-and-exporting-form-data).

## Conclusion

I hope you now have an easy solution to filling in form data using the [Xamarin PDF Viewer control](https://www.syncfusion.com/xamarin-ui-controls/xamarin-pdf-viewer). Using the export and import functionality, you can store or maintain a PDF document’s form data separate from the document. You can also quickly transfer these exported files (XFDF, FDF, XML, and JSON), since the memory size of these files will be much less when compared to the size of an entire PDF document.

If you are an existing Syncfusion user, please download the latest version from the [License and Downloads](https://www.syncfusion.com/account/downloads) page and try the new features for yourself. Our NuGet packages are available on [NuGet.org](https://www.nuget.org/). If you aren’t a customer yet, you can try our 30-day [free trial](https://www.syncfusion.com/downloads) to check out these features. Our other samples are available from this [GitHub](https://github.com/syncfusion/xamarin-demos/tree/master/Forms/PdfViewer) location.

If you wish to send us feedback or would like to submit any questions, please feel free to post them in the comments section below. Contact us through our [support forum](https://www.syncfusion.com/forums), [Direct-Trac,](https://www.syncfusion.com/support/directtrac/) or [feedback portal](https://www.syncfusion.com/feedback/). We are happy to assist you!

_If you liked this post, we think you will also enjoy the following:_

- [Ebook] [_PDF Succinctly_](https://www.syncfusion.com/ebooks/pdf)
- [Ebook] [_Xamarin Forms Succinctly_](https://www.syncfusion.com/ebooks/xamarin-forms-succinctly)
- [Blog] [Adding a Custom Stamp to a PDF Using Xamarin PDF Viewer](https://dev.to/syncfusion/adding-a-custom-stamp-to-a-pdf-using-xamarin-pdf-viewer-2hg)
- [Blog] [Interactive Form Filling in Four Easy Steps](https://www.syncfusion.com/blogs/post/interactive-form-filling-in-pdf-using-pdf-viewer-control.aspx)

The post [Fill PDF Forms on the Go with Import and Export Form Data Support in Xamarin PDF Viewer](https://www.syncfusion.com/blogs/post/fill-pdf-forms-with-import-and-export-form-data-in-xamarin-pdf-viewer.aspx) appeared first on [Syncfusion Blogs](https://www.syncfusion.com/blogs).