Back to Devexpress

PdfViewerControl.ExportFormData() Method

wpf-devexpress-dot-xpf-dot-pdfviewer-dot-pdfviewercontrol-cd43f572.md

latest3.7 KB
Original Source

PdfViewerControl.ExportFormData() Method

Exports interactive form data either to XML or FDF form data format.

Namespace : DevExpress.Xpf.PdfViewer

Assembly : DevExpress.Xpf.PdfViewer.v25.2.dll

NuGet Package : DevExpress.Wpf.PdfViewer

Declaration

csharp
public void ExportFormData()
vb
Public Sub ExportFormData

Remarks

The ExportFormData method invokes the Save As dialog window, where you can specify the desired file format (XML or FDF) and a file name to export a document with interactive forms.

You can call the ExportFormData method in the PdfViewerControl.DocumentLoaded event handler after a PDF document is loaded.

View Example

xaml
<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="ExportFormData.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxpdf:PdfViewerControl x:Name="Viewer" DocumentLoaded="Viewer_DocumentLoaded" />
    </Grid>
</Window>
csharp
using System.Windows;

namespace ExportFormData
{

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            //Load a PDF file with an interactive form
            Viewer.OpenDocument("..\\..\\FormFillDemo.pdf");
        }

        private void Viewer_DocumentLoaded(object sender, RoutedEventArgs e)
        {
            //Load a PDF file with an interactive form
            Viewer.ExportFormData();
        }
    }
}
vb
Imports System.Windows

Namespace ExportFormData

    Partial Public Class MainWindow
        Inherits Window

        Public Sub New()
            InitializeComponent()
            ' Load a PDF file with an interactive form
            Viewer.OpenDocument("..\..\FormFillDemo.pdf")
        End Sub

        Private Sub Viewer_DocumentLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
            ' Load a PDF file with an interactive form
            Viewer.ExportFormData()
        End Sub
    End Class
End Namespace

You can use PdfViewerExtensions.Export method to export interactive form data with specified format settings. Add DevExpress.Docs reference to your application to access extension methods.

Important

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use this member in production code. Refer to the DevExpress Subscription page for pricing information.

Refer to the How to: Export the AcroForm Data topic for more information.

See Also

PdfViewerControl Class

PdfViewerControl Members

DevExpress.Xpf.PdfViewer Namespace