Oldschool Posted January 24, 2008 Author Share Posted January 24, 2008 Whats the dependency of the MODI object?MODI2003.exe is what you need, I don't think Office is required at all...although I could be wrong.http://www.microsoft.com/downloads/details...;displaylang=en Link to comment Share on other sites More sharing options...
AzKay Posted January 24, 2008 Share Posted January 24, 2008 (edited) Odd. Installed it, Says the object doesnt exist.EDIT::Appears, All there is in that is a helpfile, A html page. and a messagebox that says "LULULULINSTALLED".EDIT:::"Important The MODI programmability features that are described in this document are available only in Microsoft® Office Document Imaging 2003. The Microsoft® Office XP version of Document Imaging did not include a progammable object model." Edited January 24, 2008 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Oldschool Posted January 25, 2008 Author Share Posted January 25, 2008 (edited) Don't know what to tell you...I have Office installed on my PC, so it worked out of the box...Maybe try to regsrv32 that dll.EDIT:http://forums.microsoft.com/MSDN/ShowPost....81&SiteID=1 Edited January 25, 2008 by Oldschool Link to comment Share on other sites More sharing options...
Elvira Posted January 25, 2008 Share Posted January 25, 2008 hello there, i'm trying the ocr script as well and i've found a problem that i'm not able to avoid If the captured part of the screen doesn't contain any text to ocr, the script stops himself with an error. C:\Programmi\AutoIt3\Examples\OCR SCRIPT.au3 (52) : ==> The requested action with this object has failed.: $oDoc.Ocr(16, True, False) $oDoc.Ocr(16, True, False)^ ERROR >Exit code: 1 Time: 24.917 this is the code that i'm using expandcollapse popup#include <ScreenCapture.au3> while 1 FileInstall( "c:\programmi\MiniCap\MiniCap.exe", @SYSTEMDIR & "\" ) $sTargetImage = "D:\programmi\ocrtesto.gif" $sTargetTitle = "Last Land" WinWaitActive( $sTargetTitle ) sleep (100) ;Capture the target by position $aPos = WinGetPos( $sTargetTitle ) $sSwitches = ' -save "' & $sTargetImage & '"' $sSwitches &= ' -captureregion ' & 310 & ' ' & 640 & ' ' & 634 & ' ' & 683 $sSwitches &= ' -exit' RunWait( @COMSPEC & ' /c minicap.exe ' & $sSwitches, "", @SW_HIDE) ;image magick part $oMagic = ObjCreate("ImageMagickObject.MagickImage.1") $ret = $oMagic.Convert("d:\programmi\ocrtesto.gif", _ "-black-threshold", "88%", "d:\programmi\ocrtesto1.gif") sleep (1000) ;~ $img = ObjCreate("ImageMagickObject.MagickImage.1") ;~ $ret = $img.Convert("d:\programmi\ocrtesto.gif", _ ;~ "-resize", "1024x768", _ ;~ "d:\programmi\last land\ocrtestonew.gif") ;~ ;~ $sTargetImage = "d:\programmi\ocrtestonew.gif" ;immagine da scansionare ingrandita ;~ $sTargetImage1 = "d:\programmi\ocrtesto.gif" ;immagine da scansionare originale ;WinWaitActive( "Gimp" ) $sTargetImage = "D:\programmi\ocrtesto1.gif" $sTargetText = _OCRGetText( $sTargetImage ) tooltip ($sTargetText, 0, 900) ;Display the results ;Msgbox( 0, @SCRIPTNAME, "Results of OCR:" & @LF & $sTargetText ) If StringInStr($sTargetText, "built in") Then sleep (2000) Send("{ENTER}Salve{ENTER}") ;check if the built in words are in the image EndIf WEnd Func _OCRGetText( $Image ) Local $oDoc = ObjCreate("MODI.Document") $oDoc.Create($Image) If @ERROR Then Return SetError(1) $oDoc.Ocr(9, True, False) ;ENGLISH = 9 If @ERROR Then Return SetError(2) Return $oDoc.Images(0).Layout.Text $oDoc = 0 EndFunc Link to comment Share on other sites More sharing options...
AzKay Posted January 25, 2008 Share Posted January 25, 2008 Don't know what to tell you...I have Office installed on my PC, so it worked out of the box...Maybe try to regsrv32 that dll.EDIT:http://forums.microsoft.com/MSDN/ShowPost....81&SiteID=1Damn.Oh well, Thanks for taking the time to OLE it x3 # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Oldschool Posted January 26, 2008 Author Share Posted January 26, 2008 hello there, i'm trying the ocr script as well and i've found a problem that i'm not able to avoidIf the captured part of the screen doesn't contain any text to ocr, the script stops himself with an error.C:\Programmi\AutoIt3\Examples\OCR SCRIPT.au3 (52) : ==> The requested action with this object has failed.: $oDoc.Ocr(16, True, False) $oDoc.Ocr(16, True, False)^ ERROR>Exit code: 1 Time: 24.917Can you upload your image ? Link to comment Share on other sites More sharing options...
voldor Posted January 31, 2008 Share Posted January 31, 2008 Hello, as i've got to screenshot small part of screen in order to OCR that part of the screen MODI returns ERROR ( the image is too small to be recognized). So what i would like to do is to screenshot part of the screen, and paste the screenshot in a bigger image on disk and ask MODI to recognize the new created picture. My problem is that i have no API to modify a .TIFF image by "inserting" my screenshot and saving the result. Does anybody knows how to do that ? Thanks for your precious help. Link to comment Share on other sites More sharing options...
Oldschool Posted January 31, 2008 Author Share Posted January 31, 2008 Does anybody knows how to do that ?It's called Magic.ImageMagic to be exact:http://www.autoitscript.com/forum/index.php?showtopic=49065 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now