Not able to Binary Serialize RecognitionResult

Hi Team,

I am trying to Aspose.OCR.RecognitionResult object

using (MemoryStream memoryStream = new MemoryStream())
{
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(memoryStream, lst);
byteArray = memoryStream.ToArray();
}

Type ‘Aspose.OCR.RecognitionResult’ in Assembly ‘Aspose.OCR, Version=23.9.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ is not marked as serializable.

@Gpatil

If possible, can you please share the complete code snippet along with a sample image that you are using? We will investigate accordingly and share the ticket ID with you after logging in our issue tracking system.

@asad.ali
Code:
try

		{

			Log.Information("Started File Uploaded Filename {Filename}", uniquename);

			byte[] byteArray;

			//Binary Serilization 

			using (MemoryStream memoryStream = new MemoryStream())
			{
				IFormatter formatter = new BinaryFormatter();
				formatter.Serialize(memoryStream, lst);
				byteArray = memoryStream.ToArray();
			}

			//Json Serilization
			string inputStr = JsonConvert.SerializeObject(lst);

			byte[] inputBytes = Encoding.UTF8.GetBytes(inputStr);

			Stream stream = new MemoryStream(Compress(inputBytes));

			stream.Position = 0;

			Log.Information("Completed File Uploaded Filename {Filename}, Id {ID}", Filename, Fileid);
		}
		catch (Exception ex)
		{
			Log.Error("Error at Upload for File {FileID} Result Error{Error}, InnerEx {InnerEx}, Stack {Stack}", uniquename, ex.Message, ex.InnerException?.ToString(), ex.StackTrace.ToString());
			throw;
		}

CodeError_ScreenShot.jpg (225.3 KB)
Tiff File 30 pages
30PagesNewPatientInfo.7z (603.0 KB)

@Gpatil

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): OCRNET-739

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

The issues you have found earlier (filed as OCRNET-739) have been fixed in this update. This message was posted using Bugs notification tool by anna.pylaieva