Exception: ZipEntry::ReadHeader(): Bad signature

I’m getting the following error while attempting execute OCR process.

Exception: ZipEntry::ReadHeader(): Bad signature (0x00000100) at position 0x00000000


This message was posted using Email2Forum by Zaheer Tariq.

Hi there,


Thanks for your inquiry. Can you please share your sample code and image? So we will investigate the issue at our end and will provide you more information accordingly.

Sorry for the inconvenience faced.

Best Regards,

Hi, I am getting same error. I have used latest Resource file. Please help me out

Hi Amit,

We are sorry for your trouble.

Please note that each version of Aspose.OCR API uses a specific resource file. If you are using the latest version of Aspose.OCR for .NET 1.8.0 then you should be using the resource file located here. Please give the latest version a try at your end. In case the problem persists, please provide your sample image for our review.

Sample code to perform OCR operation is provided below.

C#


// image document on which OCR is to be performed
string imageFile = (“sample.jpg”);

// Initialize OcrEngine
OcrEngine ocr = new OcrEngine();

// Configure to use Default Dictionaries
ocr.Config.UseDefaultDictionaries = true;

// Load Image
ocr.Image = ImageStream.FromFile(imageFile);

// Add language
ocr.Languages.AddLanguage(Language.Load(“english”));

// OutPut file to store results
TextWriter outPut = new StreamWriter(“output.txt”);

// Load the resource file
using (ocr.Resource = new FileStream(resourceFileName, FileMode.Open))
{
try
{
// Process the whole image
if (ocr.Process())
{
outPut.WriteLine(ocr.Text);

}
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
outPut.Close();
}