Click here to Skip to main content
15,905,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
class mmm
{
    public static void main(String[] args) {
        OcrEngine ocr = new OcrEngine();
 ocr.setImage(ImageStream.fromFile("pp.tif"));
// ocr.setImage((IImageStream) new File("pp.tif"));
 ocr.getLanguages().addLanguage(Language.load("english"));
// ocr.setResource(new FolderStream(resourceFileName, FileMode.Open)));
 {
     if (ocr.process())
     {
         System.out.println(ocr.getText());
     }
 }
}
}

in above code giving error .
Exception in thread "main" com.aspose.ms.System.IO.FileNotFoundException: Can't find file: pp.tiff.
please tell me where i am wrong. i am trying to pass all formt(.png,.gif,.jpg) images.i am giving proper path
Posted
Updated 9-Oct-13 5:31am
v4
Comments
[no name] 9-Oct-13 8:39am    
Can you tell me where is the pp.tif file located??
baliram bhande 9-Oct-13 8:50am    
in project means in ellipse path
[no name] 9-Oct-13 8:54am    
Means in project root folder?
baliram bhande 9-Oct-13 8:55am    
ya
Richard MacCutchan 9-Oct-13 11:30am    
Use the full path of the file.

1 solution

Try this if Image file located on root.
 OcrEngine ocr = new OcrEngine();
 ocr.Image = ImageStream.FromFile("pp.tif"));
 ocr.Languages.AddLanguage(Language.Load("english"));


if (ocr.process())
 {
  System.out.println(ocr.getText());
 }
 
Share this answer
 
v2
Comments
baliram bhande 9-Oct-13 9:20am    
yet getting error
[no name] 9-Oct-13 9:52am    
same Error
baliram bhande 9-Oct-13 10:00am    
error is incresing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900