RyuMaou, thank you for the readiness to help and sorry, I think I have made a mistake there. Now it looks like the Create method is actually okay. I've realized that it loads the file just fine. But something is wrong with this line:
my $OCRresult = $miDoc->{Images}{'Item(0)'}{Layout}{Text};
I'm not sure how to write the following the Perl way.
expression.Item(Index)
Following is the whole test script.
Perl gives me the following error message:use warnings; use strict; use Win32::OLE; use Win32::OLE::Const; Win32::OLE::Const->Load("Microsoft Office Document Imaging 12\.0 Type +Library") or die "Cannot use the Office 2007 OCR API"; my $miDoc = Win32::OLE->new('MODI.Document') or die "Cannot create a M +ODI object"; $miDoc->Create('OCR-test.tif'); $miDoc->OCR(LangId =>'miLANG_ENGLISH'); my $OCRresult = $miDoc->{Images}{'Item(0)'}{Layout}{Text}; print $OCRresult;
Use of uninitialized value $OCRresult in print
In reply to Re^2: Why the Create method keep failing using Office 2007 OCR API?
by ZJ.Mike.2009
in thread Why the Create method keep failing using Office 2007 OCR API?
by ZJ.Mike.2009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |