officefileapi-devexpress-dot-pdf-dot-pdfviewerextensions-dot-export-x28-devexpress-dot-pdf-dot-ipdfviewer-system-dot-string-devexpress-dot-pdf-dot-pdfformdataformat-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Exports interactive form data to the file using the specified form data format. This is an extension method.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Docs.v25.2.dll
NuGet Package : DevExpress.Document.Processor
public static void Export(
this IPdfViewer viewer,
string fileName,
PdfFormDataFormat format
)
<ExtensionAttribute>
Public Shared Sub Export(
viewer As IPdfViewer,
fileName As String,
format As PdfFormDataFormat
)
| Name | Type | Description |
|---|---|---|
| viewer | IPdfViewer |
A PdfViewer or PdfViewerControl object that implements IPdfViewer interface.
| | fileName | String |
A String, specifying the path to the file to which the document with interactive form data should be exported.
| | format | PdfFormDataFormat |
A PdfFormDataFormat enumeration value that represents one of the supported formats for form data values.
|
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.
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:
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);
}
}
}
Imports System.Windows.Forms
Imports DevExpress.Pdf
Namespace ExportAcroFormDocument
Partial Public Class Form1
Inherits Form
Public Sub New()
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)
End Sub
End Class
End Namespace
See Also