Browse our Products

Latest release

Deprecation warning

What was changed

KeySummaryCategory
OCRNET‑958Added a container class for storing recognition results.New feature
OCRNET‑960Added support for recognizing Mongolian texts.New feature
OCRNET‑961Added a method to release memory by unloading unneeded OCR modules.New feature
OCRNET‑814Significantly enhanced the performance of saving recognition results to searchable PDFs.Enhancement
OCRNET‑946Improved the calculation of line height in searchable PDFs.Enhancement

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been added to Aspose.OCR for .NET 24.12.0 release:

Aspose.OCR.OcrOutput class

A container class that stores recognition results, which is returned from all recognition methods instead of a list of Aspose.OCR.RecognitionResult objects.

It is fully backward compatible with the List<Aspose.OCR.RecognitionResult>, which means you do not have to update your existing code.

Aspose.OCR.Resources.ReleaseMemory()

Unload all OCR modules to free up memory. The downloaded module files will remain stored on your system.

If you need to use the OCR module again later, it will automatically reload into memory. Please note that the first recognition attempt may be slightly slower due to the reloading process.

Updated public APIs:

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

Aspose.OCR.Language

Aspose.OCR for .NET can now extract texts in the following languages:

ValueAlphabet
Aspose.OCR.Language.MonMongolian texts.

Aspose.OCR.AsposeOcr.Recognize()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizeHandwrittenText()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizeReceipt()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizeInvoice()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizeIDCard()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizeCarPlate()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizePassport()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Aspose.OCR.AsposeOcr.RecognizeLines()

This method now returns an optimized container object, Aspose.OCR.OcrOutput. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult objects, so no code updates are necessary at the moment.

Removed public APIs:

No changes.

Examples

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

Mongolian text recognition

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add an image to recognition batch
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source.png");
// Recognize Mongolian text
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Mon;
// Extract text from image
Aspose.OCR.OcrOutput results = recognitionEngine.Recognize(input, recognitionSettings);
Console.WriteLine(results[0].RecognitionText);

Unload OCR models from memory

// Download Chinese/English OCR model to "aspose/ocr" directory in the application working directory
Aspose.OCR.Resources.SetLocalPath("aspose/ocr");
Aspose.OCR.Resources.FetchResource("aspose-ocr-chinese-v2");
// Initialize Aspose.OCR for .NET recognition API
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add images to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source1.png");
input.Add("source2.jpg");
// Set recognition language (Chinese model is loaded to RAM)
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Chinese;
// Recognize image
Aspose.OCR.OcrOutput results = recognitionEngine.Recognize(input, recognitionSettings);
foreach(Aspose.OCR.RecognitionResult result in results)
{
    Console.WriteLine(result.RecognitionText);
}
// Unload all OCR models from memory to free up resources
Aspose.OCR.Resources.ReleaseMemory();