Syncfusion AI Assistant

How can I help you?

Export PDF Form Data

27 Apr 20264 minutes to read

The WPF PDF Viewer supports exporting form field data in multiple formats, enabling easy storage and seamless integration with other systems. Supported formats:

Follow the below steps to export data from PDF document in UI

  1. Click the form data tool button in the left pane, the form data toolbar will appear as a secondary toolbar in the PdfViewerControl.
  2. Select Export option in form data toolbar to export the PDF form data.
  3. In Export Form Data As dialog box, you can select the desired format to save the form data (FDF, XFDF, XML, and JSON).

NOTE

If the PDF document is loaded as a stream, the PdfViewerControl will request for the form name when exporting.

How to export Programmatically

ExportFormData API is used to export the form fields data in code behind.This API allows the values filled in form fields to be extracted and saved in the required format, making it useful for storing form data, sharing it with external systems, or reusing it at a later stage without manual intervention.

Export as FDF

The following example exports form field data as FDF.

private void button1_Click(object sender, RoutedEventArgs e)
{
    //Export PDF form data
    pdfviewer.ExportFormData("Export.fdf", Syncfusion.Pdf.Parsing.DataFormat.Fdf, "SourceForm.pdf");
}
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
    'Export PDF form data
    pdfviewer.ExportFormData("Export.fdf", Syncfusion.Pdf.Parsing.DataFormat.Fdf, "SourceForm.pdf")
End Sub

Export as XFDF

The following example exports form field data as XFDF.

private void button1_Click(object sender, RoutedEventArgs e)
{
    //Export PDF form data
    pdfViewer.ExportFormData("Export.xfdf", Syncfusion.Pdf.Parsing.DataFormat.XFdf, "SourceForm.pdf");
}
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
    'Export PDF form data
    pdfViewer.ExportFormData("Export.xfdf", Syncfusion.Pdf.Parsing.DataFormat.XFdf, "SourceForm.pdf")
End Sub

Export as JSON

The following example exports form field data as JSON.

private void button1_Click(object sender, RoutedEventArgs e)
{
    //Export PDF form data
    pdfViewer.ExportFormData("Export.json", Syncfusion.Pdf.Parsing.DataFormat.Json, "SourceForm.pdf");
}
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
    'Export PDF form data
    pdfViewer.ExportFormData("Export.json", Syncfusion.Pdf.Parsing.DataFormat.Json, "SourceForm.pdf")
End Sub

Export as XML

The following example exports form field data as XML.

private void button1_Click(object sender, RoutedEventArgs e)
{
    //Export PDF form data
     pdfViewer.ExportFormData("Export.xml", Syncfusion.Pdf.Parsing.DataFormat.Xml, "SourceForm.pdf");
}
Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
    'Export PDF form data
     pdfViewer.ExportFormData("Export.xml", Syncfusion.Pdf.Parsing.DataFormat.Xml, "SourceForm.pdf")
End Sub

Common Use Cases

  • Save user-entered data to your server without altering the original PDF.
  • Export as JSON for REST API integration.
  • Export as FDF/XFDF for compatibility with other PDF tools.

See also