Fill PDF Forms on the Go with Import and Export Form Data Support in Xamarin PDF Viewer | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (174).NET Core  (29).NET MAUI  (207)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (215)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (118)PDF  (81)Python  (1)React  (100)Streamlit  (1)Succinctly series  (131)Syncfusion  (914)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (147)Chart  (131)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (628)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (507)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (592)What's new  (332)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Fill PDF Forms On the Go with Import and Export Form Data Support in PDF Viewer Xamarin

Fill PDF Forms on the Go with Import and Export Form Data Support in Xamarin PDF Viewer

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 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

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

Importing form data

//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 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.

To learn more about exporting and importing form data, refer to our documentation page, 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. 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 page and try the new features for yourself. Our NuGet packages are available on NuGet.org. If you aren’t a customer yet, you can try our 30-day free trial to check out these features. Our other samples are available from this GitHub location. You can also explore our AndroidiOS and UWP demo apps.

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 forumDirect-Trac, or feedback portal. We are happy to assist you!

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

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed