officefileapi-devexpress-dot-pdf-dot-pdfviewerextensions-dot-import-x28-devexpress-dot-pdf-dot-ipdfviewer-system-dot-io-dot-stream-devexpress-dot-pdf-dot-pdfformdataformat-x29.md
Imports interactive form data from a specified stream using 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 Import(
this IPdfViewer viewer,
Stream stream,
PdfFormDataFormat format
)
<ExtensionAttribute>
Public Shared Sub Import(
viewer As IPdfViewer,
stream As Stream,
format As PdfFormDataFormat
)
| Name | Type | Description |
|---|---|---|
| viewer | IPdfViewer |
A PdfViewer or PdfViewerControl object that implements the IPdfViewer interface.
| | stream | Stream |
A Stream value, specifying the stream containing the document with interactive form data.
| | format | PdfFormDataFormat |
A PdfFormDataFormat enumeration value that lists formats used to import the file with 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 demonstrates how to import AcroForm data (interactive form data) from XML format to a PDF document.
You can also import the AcroForm data from FDF, XFDF, and TXT formats, as described below.
To import interactive forms from XML format:
Note
You may need to add the DevExpress.Docs reference to your application to access the PdfViewer.Import extension methods.
using System.Windows.Forms;
using DevExpress.Pdf;
namespace ImportAcroForm {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
// Load a PDF document with AcroForm data.
pdfViewer1.LoadDocument("..\\..\\InitialAcroForm.pdf");
// Import the document from an XML format.
pdfViewer1.Import("..\\..\\FilledAcroForm.xml");
// Save the imported document.
pdfViewer1.SaveDocument("..\\..\\ImportedAcroForm.pdf");
}
}
}
Imports System.Windows.Forms
Imports DevExpress.Pdf
Namespace ImportAcroForm
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
' Load a PDF document with AcroForm data.
pdfViewer1.LoadDocument("..\..\InitialAcroForm.pdf")
' Import the document from an XML format.
pdfViewer1.Import("..\..\FilledAcroForm.xml")
' Save the imported document.
pdfViewer1.SaveDocument("..\..\ImportedAcroForm.pdf")
End Sub
End Class
End Namespace
See Also