FormImporter Plugin

Overview

The Aspose.Pdf.LowCode.FormImporter plugin imports form values into a PDF document. Use FormImporterJsonOptions when the form data source is JSON.

Import JSON form data

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ImportFormDataWithPlugin()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Forms();

    // Create PDF FormImporter plugin
    var plugin = new Aspose.Pdf.LowCode.FormImporter();

    // Add PDF and JSON input files
    var options = new Aspose.Pdf.LowCode.FormImporterJsonOptions();
    options.AddInput(
        new Aspose.Pdf.LowCode.FileDataSource(dataDir + "TextField.pdf"),
        new Aspose.Pdf.LowCode.FileDataSource(dataDir + "TextField.json"));
    options.AddOutput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "ImportFormDataWithPlugin_out.pdf"));

    // Import form data
    var result = plugin.Process(options);

    // Get the path of the saved PDF document
    var outputPath = result.ResultCollection[0].ToFile();
}

Input pairs

FormImporterJsonOptions.AddInput accepts a PDF data source and a matching JSON data source. Add output targets before calling Process.