How to: Import the AcroForm Data
- 2 minutes to read
This example demonstrates how to import AcroForm data (interactive form data) from XML or FDF format to a PDF document.
- Load a document with interactive forms (e.g., from a file path) into the PDF Viewer using the DocumentViewerControl.OpenDocument method.
Call the PdfViewerControl.ImportFormData method in the PdfViewerControl.DocumentLoadedEvent event handler.
The import method invokes the Open dialog window, where you can specify the file name and file format (XML or FDF) from which a PDF document with interactive form is loaded.
- To save the imported document, (e.g., to a file), call the PdfViewerControl.SaveDocument method with a specified file name, including a file path where the imported document will be located.
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf"
x:Class="ImportFormData.MainWindow"
Title="MainWindow" Height="450" Width="600">
<Grid>
<dxpdf:PdfViewerControl x:Name="Viewer"
DocumentLoaded="Viewer_DocumentLoaded"
DocumentClosing="Viewer_DocumentClosing"/>
</Grid>
</Window>