Import FDF into PDF

Import FDF (Form Data Format) into a PDF form and save the PDF with imported data.

The data in PDF forms can be exported as a FDF file, which allows you to quickly insert it into databases among other uses. In this code sample we will show how you can easily import an FDF file and populate the form fields in a PDF.

//import PDF document where the fields will be filled
using (FileStream fileIn = new FileStream(@"..\..\..\inputDocuments\fw4.pdf", FileMode.Open, FileAccess.Read))
{
    Document document = new Document(fileIn);

    //import form data, which automatically fills the fields in fw4.pdf
    using (FileStream fdfFile = new FileStream(@"..\..\fw4.fdf", FileMode.Open, FileAccess.Read))
    {
        FdfFormData fdfData = new FdfFormData(fdfFile);
        document.Import(fdfData);
    }

    //export the filled out pdf to disk
    using (FileStream fileOut = new FileStream(@"..\..\fw4_afterimport.pdf", FileMode.Create, FileAccess.Write))
    {
        document.Write(fileOut);
    }
}
Using fileIn As New FileStream("..\..\..\inputDocuments\fw4.pdf", FileMode.Open, FileAccess.Read)
            Dim document As New Document(fileIn)

            Using fdfFile As New FileStream("..\..\fw4.fdf", FileMode.Open, FileAccess.Read)
                Dim fdfData As New FdfFormData(fdfFile)
                document.Import(fdfData)
            End Using

            Using fileOut As New FileStream("..\..\fw4_afterimport.pdf", FileMode.Create, FileAccess.Write)
                document.Write(fileOut)
            End Using
End Using
Download PDFKit.NET 5.0
We will send you a download link
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download

We have sent an email with a download link. Alternatively, you may want to use the NuGet package manager to install our library.

Nuget ID

Use the NugetID and start right away, or download the package and install it handmatically