I tries your demo program to see the text values.
There is no output.
If it works, how do I convert to pdf file?
Thanks
Chang Shin
String imagePath = “/AATest/Email/Test/screenshot.bmp”;
String xmlEtalonFileName = “englishStandarts”;
String fontCollectionFileName = “arialAndTimesAndCourierRegular.xml.bin”;
String resourcesFilePath = “/AATest/Email/Test/resources.zip”;
try
{
// Create an instance of OcrEngine class but providing required
// parameters
OcrEngine ocr = new OcrEngine(ResourcesSource.BINARY_ZIP_FILE,
resourcesFilePath, xmlEtalonFileName, fontCollectionFileName);
ocr.getConfig().setNeedRotationCorrection(false);
// Set image file
File image = new File(imagePath);
ocr.setImage(image);
// Add language
ILanguage language = Language.load(“english”);
ocr.getLanguages().addLanguage(language);
// Create a new file to write output
Writer output = null;
File file = new File("/AATest/Email/Test/Output.txt");
output = new java.io.BufferedWriter(new java.io.FileWriter(file));
// Perform OCR and get extracted text
if (ocr.process())
{
output.write("\ranswer -> " + ocr.getText());
// Get info about each part of the recognized text
IRecognizedText recognizedText = ocr.getText();
IRecognizedTextPartInfo[] parts = recognizedText.getPartsInfo();
System.out.println(“parts.size() =”+parts.length);
for (IRecognizedTextPartInfo part : parts)
{
output.write("\r\n\r\npart.getText() => " + part.getText());
}
output.close();
System.out.println(“Done”);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}