Nuget package version for Windows Server 2019

I was able to get Aspose.OCR v 20.12.1 to work, but it uses older methods. I’ve tried the newest version (v 25.9.1) and it gives me a ‘access violation’ error. I’m trying to do Recognize using a bitmap over a memory stream.

@tfid

It seems you’re experiencing an ‘access violation’ error when using Aspose.OCR version 25.9.1 with a bitmap over a memory stream. This issue may be related to compatibility or changes in the API between versions.

To troubleshoot this, I recommend the following steps:

  1. Check for Updates: Ensure that you are using the latest version of Aspose.OCR. Newer versions often fix bugs present in previous releases.

  2. Review Documentation: Look for any breaking changes or updated methods in the release notes for version 25.9.1. This can help you adjust your code accordingly.

  3. Sample Code: Here’s a basic example of how to use Aspose.OCR with a bitmap from a memory stream:

    using Aspose.Ocr;
    using System.Drawing;
    using System.IO;
    
    public void RecognizeTextFromBitmap()
    {
        using (MemoryStream memoryStream = new MemoryStream())
        {
            // Load your bitmap image into the memory stream
            Bitmap bitmap = new Bitmap("path_to_your_image.png");
            bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Png);
            memoryStream.Position = 0;
    
            // Create an instance of the OcrEngine
            OcrEngine ocrEngine = new OcrEngine();
    
            // Load the image from the memory stream
            using (var imageStream = new MemoryStream(memoryStream.ToArray()))
            {
                ocrEngine.Image = ImageStream.FromStream(imageStream);
                if (ocrEngine.Process())
                {
                    string recognizedText = ocrEngine.Text.ToString();
                    Console.WriteLine(recognizedText);
                }
            }
        }
    }
    
  4. Contact Support: If the issue persists, consider reaching out to Aspose support for assistance, as they can provide more specific guidance based on your environment and usage.

For further assistance, refer to the official Aspose documentation and community forums for any similar issues reported by other users.

This seems like an AI response. The sample code doesn’t help. I did all that (except the bogus code). Now I’m at step 4 - contact support. So I ask again - What Nuget package version do I need to use for Window server 2019?

@tfid

Please make sure that your project targets .NET Framework 4.6.1 or higher and use below code sample with the latest version of the API:

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add(dataDir + "sample.bmp");
// Set recognition language
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Eng;
// Recognize image
var results = recognitionEngine.Recognize(input, recognitionSettings);
Aspose.OCR.AsposeOcr.SaveMultipageDocument(dataDir + "output.pdf", Aspose.OCR.SaveFormat.Pdf, results);

In case you still face any issues, please feel free to let us know. We will further proceed to assist you accordingly.