Articles in this section
Category / Section

How to Import FDF into a PDF form

5 mins read

The Syncfusion Essential® PDF is a comprehensive, high-performance .NET PDF library that enables you to create, read, and edit PDF documents. Using this library, you can load an FDF file in the FileStream, then import the FDF stream data into the PdfLoadedForm.

Steps to Import FDF Data into a PDF Form

  1. Create a new console application project.
    Console App.png
  2. Install the Syncfusion.Pdf.Net.Core NuGet package as a reference in your console application from NuGet.org.
    NuGet Package.png
  3. Include the following namespaces in the Program.cs file.

C#

using Syncfusion.Pdf.Parsing;
  1. Use the following code sample in Program.cs to import FDF into a PDF form.

C#

// Get stream from an existing PDF document.
FileStream docStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read);
// Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
// Get stream from an existing FDF document.
FileStream fdfStream = new FileStream("ImportFDF.fdf", FileMode.Open, FileAccess.Read);
// Import the FDF stream.
loadedDocument.Form.ImportDataFDF(fdfStream, true);
// Save the document into a stream.
MemoryStream stream = new MemoryStream();
loadedDocument.Save(stream);
// Close the document.
loadedDocument.Close(true);
A complete working sample is available for download from GitHub.

By executing the program, you will generate the following PDF document.

Take a moment to peruse the documentation to learn how to add form fields in a PDF document.

Conclusion
I hope you enjoyed learning how to import FDF data into a PDF form.

You can refer to our ASP.NET Core PDF feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET Core PDF example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied