Import and Export Form Field
Contents
[
Hide
]
Aspose.PDF for .NET provides great capabilities for create/manipulating form fields inside PDF document. Using this API, you can programmatically fill form fields inside PDF file, fill form fields by Import Data from FDF into a PDF File, Import Data from XFDF into a PDF File, Import Data from XML into a PDF File or even you can import data from System.Data.DataTable object.
public static void ImportData()
{
var editor = new Form();
editor.BindPdf(dataDir + "Sample-Form-01.pdf");
editor.ImportFdf(System.IO.File.OpenRead(dataDir + "Sample-Form-01-upd.fdf"));
editor.ImportXml(System.IO.File.OpenRead(dataDir + "Sample-Form-01-upd.xml"));
editor.ImportXfdf(System.IO.File.OpenRead(dataDir + "Sample-Form-01-upd.xfdf"));
editor.Save(dataDir + "Sample-Form-01-updated.pdf");
}
Export Data from FDF into a PDF File
public static void ExportData()
{
var editor = new Form();
editor.BindPdf(dataDir + "Sample-Form-01.pdf");
editor.ExportFdf(System.IO.File.OpenWrite(dataDir + "Sample-Form-01-mod.fdf"));
editor.ExportXml(System.IO.File.OpenWrite(dataDir + "Sample-Form-01-mod.xml"));
editor.ExportXfdf(System.IO.File.OpenWrite(dataDir + "Sample-Form-01-mod.xfdf"));
}