.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfViewerExtensions.Export(IPdfViewer, Stream, PdfFormDataFormat) Method

Exports interactive form data to a specified stream using form data format. This is an extension method.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll

Declaration

public static void Export(
    this IPdfViewer viewer,
    Stream stream,
    PdfFormDataFormat format
)

Parameters

Name Type Description
viewer IPdfViewer

A PdfViewer or PdfViewerControl object that implements the IPdfViewer interface.

stream Stream

A Stream value, containing the document to which interactive form data should be exported.

format PdfFormDataFormat

A PdfFormDataFormat enumeration value that represents one of the supported formats for PDF form data values.

Remarks

See Export and Import Interactive Form Data (WinForms PDF Viewer) and Export and Import of Interactive Form Data (WPF PDF Viewer) topics to learn more.

Example

Important

The Universal Subscription or an additional Office File API Subscription is required to use this example in production code. Refer to the DevExpress Subscription page for pricing information.

This example shows how to export AcroForm data (interactive form data) from a PDF document to XML format.

You can also export the AcroForm data to FDF, XFDF, and TXT formats using the approach described below.

To export AcroForm to XML format:

  • load a document containing interactive forms (e.g., from a file path) into the PDF Viewer using the PdfViewer.LoadDocument method;
  • call one of the PdfViewerExtensions.Export overloaded methods, for example, with a specified XML file name including a file path where the exported document will be located, and the XML data format.

Note

You may need to add the DevExpress.Docs reference to your application to access the PdfViewer.Export extension method.

using System.Windows.Forms;
using DevExpress.Pdf;

namespace ExportAcroFormDocument {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();

            // Load a PDF document with AcroForm data.  
            pdfViewer1.LoadDocument("..\\..\\AcroForm.pdf");

            // Export the document to the xml format.
            pdfViewer1.Export("..\\..\\AcroForm.xml", PdfFormDataFormat.Xml);
        }
    }
}
See Also