We are not able to serialize RecognitionResult using MemoryPack 1.10.0 .Can you please do the need full.
Getting attached error in MempackError.jpg (17.6 KB)
Sample Code:
public static void MemPack()
{
AsposeOcr api = new AsposeOcr();
License lic = new License();
lic.SetLicense("Aspose.Total.NET.lic");
string imgPath = @"D:\OCR\TIFFs\1PageGood.tif";
OcrInput ocrInput = new OcrInput(InputType.SingleImage);
ocrInput.Add(imgPath);
var result = api.Recognize(ocrInput);
CompleteResult Source = new CompleteResult();
CompleteResult Destination = new CompleteResult();
Source.ProcessedResults.AddRange(result);
var src = MemoryPackSerializer.Serialize(typeof(CompleteResult),Source);
Destination = MemoryPackSerializer.Deserialize<CompleteResult>(src);
AsposeOcr.SaveMultipageDocument("D:\\OCR\\TIFFs\\mempack.pdf", Aspose.OCR.SaveFormat.Pdf, Destination.ProcessedResults);
}
public partial class CompleteResult
{
[MemoryPackConstructor]
public CompleteResult()
{
ProcessedResults = new List<RecognitionResult>();
}
[MemoryPackAllowSerialize]
public List<RecognitionResult> ProcessedResults { get; set; }
}
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-771
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.
The ticket is sadly not fully investigated yet. However, we will surely inform as soon as its analysis is done and we have some news related to its fix ETA. Please spare us some time.
Investigation under the ticket has been underway under our schedule. However, it is not yet completed. As soon as it is done, we will share updates with you. Please spare us some time.
I understand your problem. Your library demands the attributes before the fields in the classes for serialization. Our RecognitionResult supports general serialization. So I can advise you:
use Binary or Soap serialization (RecognitionResult supports BinaryFormatter and SoapFormatter)
make a deep copy of RecognitionResult into your class with attributes
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.