I tried the following sample snippets but got error “The type initializer for ' ’ threw an exception. - The type initializer for ‘Microsoft.ML.OnnxRuntime.NativeMethods’ threw an exception.” at this line var res = api.RecognizePdf(dataDir + “BRZ0000001.pdf”, settings);
Can you tell me what I did wrong?
// C# Code
var api = new OCR.AsposeOcr();
var settings = new OCR.DocumentRecognitionSettings();
settings.StartPage = 0;
//settings.PagesNumber = 2;
//settings.LinesFiltration = true;
settings.DetectAreas = true;
settings.DetectAreasMode = OCR.DetectAreasMode.COMBINE;
settings.ThreadsCount = 1;
var res = api.RecognizePdf(dataDir + “BRZ0000001.pdf”, settings);
OCR.AsposeOcr.SaveMultipageDocument(dataDir + “test2.pdf”, OCR.SaveFormat.Pdf, res);