@juliavi.work
We are testing the scenario in our environment by using the code snippet that you have shared. However, we were unable to find the usage of skew angle in your code that you extracted using Aspose.Imaging. Also, the list of rectangles i.e. listRectangles is not defined anywhere in the code that you have shared.
Please check the below final code snippet that we were able to prepare from the screenshots:
// Convert Images
var result = new List<Stream>();
var docPdf = new Document("491246-4-pages.pdf");
// max 4 pages for demo
var cntPages = Math.Min(4, docPdf.Pages.Count);
foreach(Page page in docPdf.Pages)
{
foreach(var img in page.Resources.Images)
{
if(Math.Max(img.Width, img.Height) > 800)
{
var ms = new MemoryStream();
img.Save(ms, ImageFormat.Jpeg);
result.Add(ms);
}
}
}
foreach (MemoryStream ms in result)
{
var ocr = new AsposeOcr();
RecognitionSettings rs = new RecognitionSettings();
rs.AutoSkew = true;
rs.DetectAreas = true;
rs.RecognizeSingleLine = false;
rs.Language = Language.Eng;
var extractedText = ocr.RecognizeImage(ms, rs);
Console.WriteLine(extractedText.RecognitionText); // EHNYWFSSZIYSSeei
}
Please note that we need to replicate the same issue at our end that you are facing and for the purpose, we need complete sample code snippet that is able to demonstrate that. As per your particular scenario and shared files, it would really be helpful if you could please share a sample console application. It would help us in replicating the same issue at our end and address it accordingly.