Import FDF data

Docotic.Pdf Library Help > Samples > Forms and Annotations > Import FDF data
Docotic.Pdf documentation

This sample shows how to populate a PDF form with data from a Forms Data Format (FDF) file.

You should use PdfDocument.ImportFdf() method to import form data and fill corresponding fields in a PDF form.

C# 
using System.Diagnostics;

namespace BitMiracle.Docotic.Pdf.Samples
{
    public static class ImportFdfData
    {
        public static void Main()
        {
            // NOTE: 
            // When used in trial mode, the library imposes some restrictions.
            // Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            // for more information.

            string pathToFile = "ImportFdfData.pdf";

            using (PdfDocument pdf = new PdfDocument("Sample data/form.pdf"))
            {
                pdf.ImportFdf("Sample data/form.fdf");

                pdf.Save(pathToFile);
            }

            Process.Start(pathToFile);
        }
    }
}
Visual Basic 
Imports System.Diagnostics

Imports BitMiracle.Docotic.Pdf

Namespace BitMiracle.Docotic.Pdf.Samples
    Public NotInheritable Class ImportFdfData
        Public Shared Sub Main()
            ' NOTE: 
            ' When used in trial mode, the library imposes some restrictions.
            ' Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            ' for more information.

            Dim pathToFile As String = "ImportFdfData.pdf"

            Using pdf As New PdfDocument("Sample data/form.pdf")
                pdf.ImportFdf("Sample data/form.fdf")

                pdf.Save(pathToFile)
            End Using

            Process.Start(pathToFile)
        End Sub
    End Class
End Namespace