GroupDocs.Parser for .NET 23.10 Release Notes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
PARSERNET-2151Improve template fields parsing functionalityImprovement
PARSERNET-2150Implement the ability to set CASE of template fieldsFeature

Public API and Backward Incompatible Changes

Improve template fields parsing functionality

Description

This features allows to set the size of the border that is ignored when captured by the rectangular area.

Public API changes

PageAreaOptions public class was updated with changes as follows:

PageTextAreaOptions public class was updated with changes as follows:

TemplateOptions public class was added.

Template public class was updated with changes as follows:

  • Added Template(IEnumerable, TemplateOptions) constructor.
  • Added Options property.

Usage

The following example shows how to set the size of the border that is ignored when captured by the rectangular area:

// Define a barcode field
TemplateBarcode barcode = new TemplateBarcode(
    new Rectangle(new Point(405, 55), new Size(100, 50)),
    "QR");

// Create a template with the size of the border with 50% of the item height
Template template = new Template(new TemplateItem[] { barcode }, new TemplateOptions(0.5));

// Create an instance of Parser class
using (Parser parser = new Parser(Constants.SamplePdfWithBarcodes))
{
    // Iterate over document pages
    foreach (DocumentPageData data in parser.ParsePagesByTemplate(template))
    {
        // Print the page index
        Console.WriteLine("Page: " + data.PageIndex);

        // Print all extracted data
        for (int i = 0; i < data.Count; i++)
        {
            Console.Write(data[i].Name + ": ");
            PageBarcodeArea area = data[i].PageArea as PageBarcodeArea;
            Console.WriteLine(area == null ? "Not a template barcode field" : area.Value);
        }
    }
}

Improve template fields parsing functionality

Description

This improvement allows to set the case of the field name.

Public API changes

TemplateBarcode public class was updated with changes as follows:

TemplateField public class was updated with changes as follows:

  • Added TemplateField(TemplatePosition, string, int?, bool) constructor.

TemplateTable public class was updated with changes as follows:

  • Added TemplateTable(TemplateTableLayout, string, int?, bool) constructor.
  • Added TemplateTable(TemplateTableParameters, string, int?, bool) constructor.

Usage

The following example shows how to create an instance of template item without name case converting:

// Create an instance of barcode field
TemplateBarcode barcode = new TemplateBarcode(rectangle, "FieldName", 1, false);

// Create an instance of text field
TemplateField field = new TemplateField(position, "FieldName", 1, false);

// Create an instance of table field with layout
TemplateTable table = new TemplateTable(layout, "TableName", null, false);

// Create an instance of table field with table parameters
TemplateTable table = new TemplateTable(parameters, "TableName", 1, false);