GroupDocs.Parser for .NET 24.5 Release Notes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
PARSERNET-2212Implement the ability to export the extracted data to JSON and XML formatsFeature

Public API and Backward Incompatible Changes

Implement the ability to export the extracted data to JSON and XML formats

Description

This feature allows to export data to JSON or XML files.

Public API changes

Added ExporterBase public class.

Added JsonExporter public class.

Added XmlExporter public class.

Added Extensions public class.

PageTableArea public class was updated with changes as follows:

Usage

The following example shows how to extract barcodes from a document and export them to the JSON file:

// Create an instance of Parser class
using (Parser parser = new Parser(Constants.SamplePdfWithBarcodes))
{
    // Check if the document supports barcodes extraction
    if (!parser.Features.Barcodes)
    {
        Console.WriteLine("Document doesn't support barcodes extraction.");
        return;
    }

    // Create the options which are used for barcodes extraction
    BarcodeOptions options = new BarcodeOptions(QualityMode.Low, QualityMode.Low, "QR");

    // Extract barcodes from the document
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(options);
    
    // Export data to "data.json" file
    barcodes.ExportAsJson("data.json");
}