Browse our Products

Aspose.OMR for .NET 22.9 Release Notes

What was changed

KeySummaryCategory
OMRNET-614Added the ability to set the memory stream or file encoding in the GenerateTemplate method.Enhancement
OMRNET-614Inline paragraphs (text markup / JSON markup): placing all paragraph elements on the same line.New feature
OMRNET-614Vertical alignment of elements inside inline paragraphs (text markup / JSON markup).New feature
OMRNET-614Automatic column wrapping can be enabled in the page settings.New feature
OMRNET-614Individual adjustment of top, bottom, left, and right border for CustomAnswerSheet (text markup / JSON markup), Block (text markup / JSON markup), InputGroup (text markup / JSON markup), and TableTitle (text markup / JSON markup) elements.New feature
OMRNET-614Switching bubble placement for Answer elements (text markup / JSON markup).New feature
OMRNET-614Setting text color for Text (text markup / JSON markup), Content (text markup / JSON markup) and WriteIn (text markup / JSON markup) elements.New feature
OMRNET-614Customizing the underlying label of WriteIn elements (text markup / JSON markup).New feature

Known issues and limitations

KeySummaryWorkaround
OMRNET-462Recognition of multi-page PDF and TIFF files causes an error.Scan each page of the filled form into a separate file and recognize them one-by-one.
OMRNET-555Recalculate method results in incorrect processing of ScoreGroup elements (text markup / JSON markup) and CustomAnswerSheet elements (text markup / JSON markup).Use RecognizeImage method with different threshold setting instead of run-time adjustments of recognition accuracy.

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been added in this release:

Vertical alignment of paragraph elements

A new vertical_align attribute / property has been added to paragraphs. It controls how inline elements of different sizes align vertically within the lines of a paragraph:

ValueAlignment
topThe elements are aligned with the top of the tallest element on the line.
centerSmaller elements are placed in the middle of the line (default).
bottomThe bottom of the elements are aligned with the bottom of the entire line.

Automatic column wrapping

A new Wrap property has been added to page settings that allows to enable automatic wrapping of columns in multi-column layouts:

ValueAlignment
Aspose.OMR.Generation.WrappingPolicy.NoneDisable column wrapping (default).
Aspose.OMR.Generation.WrappingPolicy.ColumnEnable column wrapping.

Individual adjustment of element borders

New attributes / properties have been added to CustomAnswerSheet (text markup / JSON markup), Block (text markup / JSON markup), InputGroup (text markup / JSON markup), and TableTitle (text markup / JSON markup) elements that allow to control the width and color of each element border:

PropertyBorder
border_top_styleTop border
border_bottom_styleBottom border
border_left_styleLeft border
border_right_styleRight border

These properties override the size (border_size) and color (border_color) of the element’s global border.

The value of the property is provided in <border width> <border color> format, for example border_right_style=10 blue. You can also specify none to remove the corresponding border.

Bubble placement

The bubble position of an Answer element (text markup / JSON markup) can be switched with bubble_position attribute / property:

ValuePosition
leftPlace a bubble to the left on the answer (default).
rightPlace a bubble to the right on an answer.

Text color

A new color attribute / property has been added to Text (text markup / JSON markup), Content (text markup / JSON markup) and WriteIn (text markup / JSON markup) elements.

It allows to define the color of an element’s text.

Underlying label of WriteIn elements

A new hint attribute / property has been added to WriteIn elements (text markup / JSON markup). It allows to re-define an underlying label of the write-in field.

By default, a write-in field has a label “write-in”.

Updated public APIs:

The following public APIs have been updated in this release:

OMR form source encoding

An optional parameter of type System.Text.Encoding has been added to GenerateTemplate method which allows to determine the encoding of the form source file or memory stream.

By default, content is treated as UTF-8.

Removed public APIs:

No changes.

Usage examples

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

OMR form source encoding

Aspose.OMR.Generation.GenerationResult generationResult = null;
using(System.IO.FileStream fs = new System.IO.FileStream("source.txt", System.IO.FileMode.Open))
{
	System.IO.MemoryStream ms = new System.IO.MemoryStream();
	fs.CopyTo(ms);
	generationResult = omrEngine.GenerateTemplate(ms, Encoding.ASCII);
};

Automatic column wrapping

Aspose.OMR.Generation.GlobalPageSettings globalPageSettings = new Aspose.OMR.Generation.GlobalPageSettings() {
	PaperSize = Aspose.OMR.Generation.PaperSize.Tabloid,
	Orientation = Aspose.OMR.Generation.Orientation.Horizontal,
	BubbleColor= Aspose.OMR.Generation.Color.Red,
	Wrap = Aspose.OMR.Generation.WrappingPolicy.Column
};

Column wrapping

Inline paragraph with vertical alignment

?paragraph=top
	type=inline
	vertical_align=top
?content=Good
	font_style=bold
	font_size=15
?content=morning
	font_style=italic
	font_size=15
?content=mister
	font_style=italic
	font_size=10
?content=Anderson
	font_style=italic
	font_size=15
&paragraph
?paragraph=center
	type=inline
	vertical_align=center
?content=Good
	font_style=bold
	font_size=15
?content=morning
	font_style=italic
	font_size=15
?content=mister
	font_style=italic
	font_size=10
?content=Anderson
	font_style=italic
	font_size=15
&paragraph
?paragraph=bottom
	type=inline
	vertical_align=bottom
?content=Good
	font_style=bold
	font_size=15
?content=morning
	font_style=italic
	font_size=15
?content=mister
	font_style=italic
	font_size=10
?content=Anderson
	font_style=italic
	font_size=15
&paragraph

Inline paragraphs

Individual adjustment of element borders

?container=
	columns_count=3
?block=
	column=3
	border=rounded
?content=rounded
	font_size=20
&block
?empty_line=
	height=100
?block=
	column=3
	border=rounded
	border_top_style=none
	border_bottom_style=10 red
?content=partial rounded
	font_size=20
&block
?empty_line=
	height=100
?block=
	column=3
	border=rounded
	border_right_style=10 blue
	border_left_style=10 red
?content=partial rounded 2
	font_size=20
&block
&container

Override individual borders

Bubble placement

?answer=Bob Barr and Wayne A. Root
	bubble_position=right
	bubble_type=square
?content=LIB
	font_size=8
	align=right
&answer

Bubble placement in answer

Text color

?text=This text will be rendered in red
	color=red

Underlying label of write-in element

?container=Example
?block=Write-in element
?content=Your phone number:
	font_style=Bold
?write_in=Phone
	required=true
	hint=phone number with country code
&block
&container

Write-in field with custom label