Browse our Products

Aspose.OCR for .NET 25.3.0 - Release Notes

What was changed

KeySummaryCategory
OCRNET‑995, OCRNET‑1000Added universal recognition of Arabic, Persian and English alphabets.New feature
OCRNET‑1002Automatic analysis of image content and detection of layout blocks.New feature
OCRNET‑1001Recognition speed improvements.Enhancement
OCRNET‑992Fixed an issue with saving recognition results to hOCR.Fix

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

Aspose.OCR.ContentArea class

This class stores a layout block detected in an image.

PropertyTypeDescription
indexintThe sequential index of the content area, unique within the entire image.
imageMemoryStreamImage region (bitmap) with the content.
RectangleAspose.OCR.RectangleThe bounding rectangle of the content area.

Aspose.OCR.LayoutOutput class

This class stores a layout block detected in an image.

PropertyTypeDescription
SourcestringThe full path to the file or URL, if applicable. Empty for images provided as a stream, byte array, or Base64.
PageintPage number for multi-page images.
ParagraphsList<Aspose.OCR.ContentArea>Detected paragraphs.
ImagesList<Aspose.OCR.ContentArea>Detected illustrations.
HeadersList<Aspose.OCR.ContentArea>Detected headers.
TablesList<Aspose.OCR.ContentArea>Detected tables.
ListsList<Aspose.OCR.ContentArea>Detected lists.
CaptionsList<Aspose.OCR.ContentArea>Detected captions.
EquationsList<Aspose.OCR.ContentArea>Detected equations.

Aspose.OCR.DetectDocumentLayout method

Analyzes images and identifies the different types of layout blocks within it. This method supports PNG, JPEG, BMP, TIFF, JFIF, and GIF images from files, streams, pixel arrays, and can bulk process folders and archives.

Detected layout blocks are returned as Aspose.OCR.LayoutOutput object.

Updated public APIs:

The following public APIs have been updated in Aspose.OCR for .NET 25.3.0 release:

Aspose.OCR.Language

Aspose.OCR for .NET can now extract mixed-language texts in Persian, Arabic and English alphabets.Use the following language identifier in recognition settings:

  • Aspose.OCR.Language.PersoArabic
  • Aspose.OCR.Language.Islamic

Removed public APIs:

No changes.

Examples

The code samples below illustrate the changes introduced in this release:

Detect and recognize tables in an image

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add an image to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source.png");
// Detect layout
Aspose.OCR.LayoutOutput layout = recognitionEngine.DetectDocumentLayout(input)[0];
List<Aspose.OCR.ContentArea> tables = layout.Tables
// Recognize tables
Aspose.OCR.OcrInput tableAreas = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
foreach(Aspose.OCR.ContentArea table in tables)
{
	tableAreas.Add(tables.image)
}
Aspose.OCR.OcrOutput recognResult = api.Recognize(tableAreas);

Recognize mixed-language image with Arabic, Persian and English characters

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add an image to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source.png");
// Recognize text
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.PersoArabic;
// Recognize image
Aspose.OCR.OcrOutput results = recognitionEngine.Recognize(input, recognitionSettings);
foreach(Aspose.OCR.RecognitionResult result in results)
{
	Console.WriteLine(result.RecognitionText);
}