in reply to Re: Why the Create method keep failing using Office 2007 OCR API?
in thread Why the Create method keep failing using Office 2007 OCR API?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why the Create method keep failing using Office 2007 OCR API?
by ZJ.Mike.2009 (Scribe) on Mar 02, 2010 at 12:06 UTC | |
|
Re^3: Why the Create method keep failing using Office 2007 OCR API?
by Anonymous Monk on Mar 02, 2010 at 03:46 UTC | |
by ZJ.Mike.2009 (Scribe) on Mar 02, 2010 at 04:15 UTC | |
by Anonymous Monk on Mar 02, 2010 at 04:31 UTC | |
by ZJ.Mike.2009 (Scribe) on Mar 02, 2010 at 04:44 UTC |