Komawoyo Posted November 13, 2008 Share Posted November 13, 2008 hello, is it possible to just use the main Dll for OCR, MDIVWCTL.DLL, instead of depending on if you have MS Office 2003/2007 installed? I have the Dll and just dont want to install the component everywhere i go for this feature. Link to comment Share on other sites More sharing options...
ptrex Posted November 14, 2008 Share Posted November 14, 2008 @KomawoyoMaybe this can give you the answer.MODIregards,ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Kyme Posted November 19, 2008 Share Posted November 19, 2008 Yeah. This can/will be very useful =D@OP Good job! I modified it though...@AllHere is my modification. Has error checking to make sure it doesn't 'crash' on you.Resizes the image 1.25x. This enables it to better 'read' the characters.Removed the cursor from the capture.Removed the ridiculously long white-space at the end of the OCR'd text.Credits go to Ronriel. I just made it work better szhlopp i have one problem....i have installed microsoft office 2007 ultimate and windows xp sp2when i try to open file(image) i got this tooltray "Error. OCR could not 'read' any characters."if i go to start menu/all programs/Microsoft Office/Microsoft Office Tools i have Microsoft Office Document Imaging and it's work awesomebut when i try to use your script non result:|i try all script from here and no one work:(( what it's wrong in this???i check the reg file and i don't have MODI.Documentis this the problem???how i can fix it???tnx Link to comment Share on other sites More sharing options...
Szhlopp Posted November 19, 2008 Share Posted November 19, 2008 szhlopp i have one problem....i have installed microsoft office 2007 ultimate and windows xp sp2when i try to open file(image) i got this tooltray "Error. OCR could not 'read' any characters."if i go to start menu/all programs/Microsoft Office/Microsoft Office Tools i have Microsoft Office Document Imaging and it's work awesomebut when i try to use your script non result:|i try all script from here and no one work:(( what it's wrong in this???i check the reg file and i don't have MODI.Documentis this the problem???how i can fix it???tnxYep it is.Control Panel>Change/remove software>MS office>Modify. Go through the screens and enable OCR RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
oMBRa Posted November 19, 2008 Share Posted November 19, 2008 Nice scripts, good job Link to comment Share on other sites More sharing options...
Kyme Posted November 19, 2008 Share Posted November 19, 2008 (edited) Yep it is.Control Panel>Change/remove software>MS office>Modify. Go through the screens and enable OCR i don't know wth it's wrong but i have installed ocr files and still don't work:((i don't know if it's this but i install all from microsoft office 2007 and nothing:|this is the option for ocr???here it's the screen from regedit modiany ideea what it's wrong??? i still get traytip "Error. OCR could not 'read' any characters."wow...now i try section read...that's work...but if i try image read didn't work and i scan on scanner some page from one workshop and nothing:| it's only text over there no images Edited November 19, 2008 by Kyme Link to comment Share on other sites More sharing options...
Szhlopp Posted November 19, 2008 Share Posted November 19, 2008 i don't know wth it's wrong but i have installed ocr files and still don't work:((i don't know if it's this but i install all from microsoft office 2007 and nothing:|this is the option for ocr???here it's the screen from regedit modiany ideea what it's wrong??? i still get traytip "Error. OCR could not 'read' any characters."wow...now i try section read...that's work...but if i try image read didn't work and i scan on scanner some page from one workshop and nothing:| it's only text over there no imagesThat error message is the ONE and ONLY error you get. if anything is wrong you get that error.And yes, you do apparently have OCR installed on your computer. RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Kyme Posted November 19, 2008 Share Posted November 19, 2008 That error message is the ONE and ONLY error you get. if anything is wrong you get that error.And yes, you do apparently have OCR installed on your computer.now i get what's the problem...when i scan the page whit scanner the paper was unlinear and the script was unable to scan it:|it's work but not with all texti have one question...it is posible to make the script to be able to read images like this???don't think i will use it for bots for forums or some like that...i am silkroad player and this will be awesome solution to pass the verification image behind the login screen tnx Link to comment Share on other sites More sharing options...
JonyGreen Posted December 14, 2015 Share Posted December 14, 2015 (edited) <snip>Thanks for your code, it's useful. Edited December 14, 2015 by Melba23 Removed big quote Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2015 Moderators Share Posted December 14, 2015 JonyGreen,if you absolutely MUST reply to an 8 year old thread just to say "thanks" then at least please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - repeating the post just pads the thread unnecessarily.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Velislav Posted March 25, 2020 Share Posted March 25, 2020 On 9/18/2008 at 10:46 AM, ronriel said: Hi, This can be quite useful. This little script lets you select any part of the screen, use OCR to read for texts,and then store them in the clipboard. You may also select image files directly and read texts in them. Just Press ALT+Q to start. UPDATE: *OCR script now tries to detect line breaks. OCR'd text will now be pasted with @CRLFS. *Removed the cursor from the captured image. expandcollapse popup;r-OCR ;By: ronriel ;updated oct. 20, 2008 ;autoit-v3.2.12.1 ;Tested Windows XP SP2 with MS Office 2007 #Include <ScreenCapture.au3> #include <WindowsConstants.au3> #Include <Misc.au3> _Singleton("script",0) Opt("GUIOnEventMode",1) Opt("WinTitleMatchMode", 4) Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) HotKeySet("!q","ShowWin") Local $err = ObjEvent("AutoIt.Error","Error") $GUI = GUICreate("", 90, 40,-1,-1,0x80880000,$WS_EX_TOOLWINDOW) WinSetTrans($GUI,'',200) $B1 = GUICtrlCreateButton("Read Region", 0, 0, 90, 20) GUICtrlSetBkColor(-1,0xe6e6fa) GUICtrlSetOnEvent(-1,"Capture") $B2 = GUICtrlCreateButton("Read File", 0, 20, 90, 20) GUICtrlSetBkColor(-1,0xe6e6fa) GUICtrlSetOnEvent(-1,"Capture") $GUI2 = GUICreate("", 0 , 0 , 0, 0, BitOR($WS_POPUP,$WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0xe6e6fa,$GUI2) WinSetTrans($GUI2,'',60) GUISetState(@SW_HIDE) $GUI3 = GUICreate("", 0 , 0 , 0,0 , BitOR($WS_POPUP,$WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0xFF0000,$GUI3) GUISetState(@SW_HIDE) TrayCreateItem("Info") TrayItemSetOnEvent(-1,'Ex') $Exit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,'Ex') TraySetState() Func ShowWin() If BitAND(WinGetState($GUI),2) Then GUISetState(@SW_HIDE,$GUI) Else $Mpos = MouseGetPos() WinMove($GUI,'',$Mpos[0]-45,$Mpos[1]-10) GUISetState(@SW_SHOW,$GUI) EndIf EndFunc Func Capture() Local $Image = @TempDir&"\ScreenCapture.png", $v = 0 If @GUI_CtrlId = $B1 Then GUISetState(@SW_HIDE,$GUI) GUISetState(@SW_SHOW,$GUI3) Do Sleep(10) ToolTip("Read Region") $c = MouseGetPos() WinMove($GUI3,"",$c[0]-2.5,$c[1]-2.5,5,5) If _IsPressed(01) Then ToolTip('') $C1 = MouseGetPos() Do Sleep(10) $C2 = MouseGetPos() If $C2[0] <> $C1[0] And $C2[1] <> $C1[1] Then GUISetState(@SW_SHOW,$GUI2) EndIf If $C1[0] < $C2[0] Then $X = $C1[0] $W = $C2[0] - $C1[0] Else $X = $C2[0] $W = $C1[0] - $C2[0] EndIf If $C1[1] < $C2[1] Then $Y = $C1[1] $H = $C2[1] - $C1[1] Else $Y = $C2[1] $H = $C1[1] - $C2[1] EndIf WinMove($GUI2,"",$X,$Y,$W,$H) WinMove($GUI3,"",$c2[0]-2.5,$c2[1]-2.5,5,5) Until Not _IsPressed(01) $v = 1 EndIf Until $v = 1 GUISetState(@SW_HIDE,$GUI2) GUISetState(@SW_HIDE,$GUI3) _ScreenCapture_Capture($Image,$x,$y,$x+$W,$y+$h,False) ElseIf @GUI_CtrlId = $B2 Then GUISetState(@SW_HIDE,$GUI) $Image = FileOpenDialog("Choose an Image File",@DesktopDir&"\","Images (*.jpg;*.bmp;*.gif;*.png;*.tif)") if @error then Return EndIf $OCR = OCR($Image) If @error then Return ClipPut($OCR) TrayTip("Info","Text saved to Clipboard",2,1) EndFunc Func OCR($Image) Local $y = 0, $string $miDoc = ObjCreate("MODI.Document") $miDoc.Create($Image) If @error Then Return SetError(1) $miDoc.Ocr(9, True, True);language is English If @error Then TrayTip("Info","OCR could not read any character.",2,1) ClipPut("Error!") Return SetError(1) EndIf For $Word In $miDoc.Images(0).Layout.Words $delim = ' ' If $miDoc.Images(0).Layout.Words($y).Rects(0).Bottom < $miDoc.Images(0).Layout.Words($y+1).Rects(0).Top Then $delim = @CRLF $string &= $Word.text & $delim $y += 1 Next Return StringTrimRight($string,1) EndFunc Func Error() Endfunc Func Ex() If @TRAY_ID = $Exit Then Exit Else MsgBox(0,"Info", "Press ALT+Q to start."&@CRLF&@CRLF&"r-OCR"&@CRLF&"By: ronriel (ronriel@yahoo.com)") EndIf EndFunc While 1 Sleep(100000) WEnd Hi! It is great peace of code! The problem is that I have office 2019 and this "Document Imaging" is no longer provided from Microsoft. I've tried to install it but with no success. Now is not possible to use MODI.Document as object I'have installed Optical Character Recognition(OCR) from Office Tools, Microsoft SharePoint Designer , but still can't make it work Can you help me? Thank you! Good Luck! 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