Browse our Products

Aspose.OMR for .NET 24.2.0 - Release Notes

What was changed

KeySummaryCategory
OMRNET‑953Added handwriting recognition plugin.New feature
OMRNET‑965Added support for handwriting recognition plugin.Enhancement

Known issues

KeySummaryWorkaround
n/aIf the handwritten character placeholder is left blank, the recognition result returns a random symbol at that position.Instruct the respondents to fill in all placeholders.

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OMR for .NET 24.2.0 that may affect the code of existing applications.

Added public APIs:

The following public APIs have been added to Aspose.OMR for .NET 24.2.0:

Handwriting recognition plugin

This plugin adds a handwritten input element to machine-readable forms and extends the recognition functionality of Aspose.OMR engine. To access new markup syntax and methods, install Aspose.OMR.Handwriting NuGet package.

You can either add the package to your existing projects, or install the package without downloading the core library. Aspose.OMR for .NET will be installed automatically through a dependency.

Compatibility

text_input text markup element

Adds a handwritten text placeholder to the form. The placeholder consists of several boxes in which the respondent can write letters or numbers, one character in each box.

The element is declared with ?text_input=[name] statement. This statement must be placed on a separate line. name property is returned in the recognition results; for example, Year,"2024". This is an optional property - you can use the same name for multiple text_input elements or just omit it. The name is not displayed on the form.

text_input element can be nested within other elements or used at the top level of the form hierarchy.

The text_input element can be customized by adding attributes to it. An attribute is written as [attribute_name]=[value]. Each attribute must be placed on a new line immediately after the opening ?text_input= statement or another attribute, and must begin with a tab character.

AttributeRequiredDescriptionUsage examples
lengthYesThe number of character input placeholders.length=5
input_typeNoThe type of allowed characters:
  • numbers (default)
  • letters
input_type=numbers
cell_sizeNoThe size of each placeholder:
  • normal (default)
  • large
  • extralarge
cell_size=large

text_input JSON markup element

Adds a handwritten text placeholder to the form. The placeholder consists of several boxes in which the respondent can write letters or numbers, one character in each box.

The element is declared as an object with "element_type": "text_input" property:

{
	"element_type": "text_input",
	"name": "Year",
	"length": 4,
}
Required properties
NameTypeDescription
lengthnumberThe number of character input placeholders.
Optional properties
NameTypeDefault valueDescription
namestringn/aUsed as a reminder of the element’s purpose and returned in the recognition results; for example, Year,"2024".
You can use the same value for multiple elements. This text is not displayed on the form.
input_typestring"numbers"The type of allowed characters:
  • "numbers"
  • "letters"
cell_sizestring"normal"The size of each placeholder:
  • "normal"
  • "large"
  • "extralarge"

TextInputConfig class

Adds a handwritten text placeholder to the form. The placeholder consists of several boxes in which the respondent can write letters or numbers, one character in each box.

Handwritten text placeholder element is declared as an instance of TextInputConfig class:

var input = new TextInputConfig();
input.Name = "Year";
input.Length = 4;
Required properties
NameTypeDescription
LengthintThe number of character input placeholders.
Optional properties
NameTypeDefault valueDescription
Namestringn/aUsed as a reminder of the element’s purpose and returned in the recognition results; for example, Year,"2024".
You can use the same value for multiple elements. This text is not displayed on the form.
InputTypeAspose.OMR.Handwriting.Generation.Config.Enums.InputTypeInputType.NumbersThe type of allowed characters:
  • InputType.Numbers
  • InputType.Letters
CellSizeAspose.OMR.Handwriting.Generation.Config.Enums.CellSizeCellSize.NormalThe size of each placeholder:
  • CellSize.Normal
  • CellSize.Large
  • CellSize.Extralarge

Updated public APIs:

No changes

Removed public APIs:

No changes

Usage examples

See the examples below to learn more about the changes introduced in this release:

Add handwriting placeholder

Application code:

var engine = new OmrEngine();
engine.AddPlugin(new HandwritingPlugin());
var generationResult = omrEngine.GenerateTemplate("source.txt");
if(generationResult.ErrorCode != 0)
{
	Console.WriteLine(generationResult.ErrorMessage);
	return generationResult.ErrorCode;
}
generationResult.Save("", "OMR-Form");

Form markup:

?text_input=Year
	length=4
	input_type=numbers
	cell_size=large

Handwritten text placeholder example

Recognize handwritten text

Application code:

var engine = new OmrEngine();
engine.AddPlugin(new HandwritingPlugin());
var templateProcessor = engine.GetTemplateProcessor("pattern.omr");
var recognitionResult = templateProcessor.Recognize("filled-form.png");
string result = recognitionResult.GetCsv();

Recognition result:

Element Name,Value,
Year,"1989"