FormExporter Plugin

Overview

The Aspose.Pdf.LowCode.FormExporter plugin exports form values from PDF documents. Use FormExporterToJsonOptions for JSON output and FormExporterValuesToCsvOptions for CSV output.

Export form data to JSON

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

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

    // Add input and output files
    var options = new Aspose.Pdf.LowCode.FormExporterToJsonOptions();
    options.AddInput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "TextField.pdf"));
    options.AddOutput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "ExportFormDataWithPlugin_out.json"));

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

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

Options

Use public field selectors on exporter options when only selected fields should be exported.