modi

Indexing Service + MODI = Full-text over OCR? You wish!

Scenario: You have configured Indexing Service to index your files, which also include scanned images saved as hi-res TIFF files. You also have installed MS Office 2003+ and configured MS Office Document Imaging (MODI) correctly so you can perform OCR on your images and even embed the OCR'd text into TIFFs. Awesomeness: Indexing Service...

Usin Microsoft Office Document Image Viewer with VBS

Hi all, I want to use Microsoft Office 2003(or 2007) Document Image (MODI) Viewer on my web site to user can scan image (from a scanner) and save image (.tif format) to a location and i want to upload this image to my site from that location. First of all, Can i use MODI Viewew with scripting? Can i get or set file save location f...

.NET OCRing an Image

I'm trying to use MODI to OCR a window's program. It works fine for screenshots I grab programmatically using win32 interop like this: public string SaveScreenShotToFile() { RECT rc; GetWindowRect(_hWnd, out rc); int width = rc.right - rc.left; int height = rc.bottom - rc.top; Bitmap bmp = new Bitmap(width, height)...

How do I use MODI in an ASP.Net Web Application?

I've written an OCR wrapper library around the Microsoft Office Document Imaging COM API, and in a Console App running locally, it works flawlessly, with every test. Sadly, things start going badly when we attempt to integrate it with a WCF service running as an ASP.Net Web Application, under IIS6. We had issues around trying to free u...

Help with debugging COM errors? (.mdi to .pdf file conversions using Microsoft Office Document Imaging)

I thought I had a working solution for converting .mdi files to PDF using the Microsoft Office Document Imaging object model. The solution is in a Windows Service, but now I'm running into some errors that I'm having trouble tracking down info on. The exception I get is: The server threw an exception. (Exception from HRESULT: 0x80...

using MODI in C# to read image - numbers with a length of 1 is missing

I am about building an C#-application in which I am trying to read text from an gif-image (OCR) - I am using MODI and the images are a bit like a lotto coupon (random numbers in rows and columns). I now got the following code which read all numbers except single numbers (1, 2, 3...) MODI.Document objModi = new MODI.Document(); objModi.C...

Using a Custom Dictionary with Microsoft's MODI

I am currently using Microsoft's MODI (Microsoft Office Document Imaging) to read text in an image in C#. Everything is working fine, except some of the words I want to read are not real English words. Is there any way to use a custom dictionary when using MODI or add words to the regular English dictionary that it uses? ...

C# OCR MODI Library, get MODI.Image from (Bitmap) Image NOT saved on hard disk.

Hi everyone, i'm coding an OCR MODI application for numbers recognition. It works quite well but i'm trying to speed it up. I need to create a MODI.Document or a MODI.Image directly from a Emgu.CV.UI.ImageBox and without loading it from the hard disk. Something like MODI.Document md = new MODI.Document(); md.Create(my_picture_box.Imag...

MODI leaking memory

I have an app where I'm using MODI 2007 to OCR several multi-page tiff files. I have found that when I kick it off on a directory that contains several good tiffs but also some tiffs that cannot be opened in Windows Picture and Fax Viewer, then MODI also fails to OCR those "bad" tiffs. When this happens, the app is unable to reclaim an...

Why is OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) causing an OCR running error?

Hi folks, I am using MODI to read tiff images and do what I need to do with the text. Some images work fine and then other tiff images always cause the method, OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) to fail. I have researched this and tried different variations such as 'false','false' in the parameter list. I have also tried...

Using MODI to extract text from OCRed PDF

Hi is it possible to extract text from an OCRed pdf file by using Microsoft Document Imaging? ...

OCR replacement for MODI

I have recently been using the builtin OCR functionality of MODI to capture text of a window. I use the window handle and could get text at any region or I could get the coordinates of specific text that I want to search for. It looks like MODI has been depricated, and it isn't included in office 2010 which we're now using, so I need...

Create file with DeleteAfterOpen, and allow other process to read the file

Is it possible to create a file using the FileStream object in .net, specifying DeleteAfterClose option and allow read access to that file? I've tried using: System.IO.FileStream strBMP = new System.IO.FileStream(sFileName, System.IO.FileMode.Create, System.Security.AccessControl.FileSystemRights., System.IO.FileShare.ReadWrite, 1024, ...

MODI gives BAD LANGUAGE error for English documents

I have been using MODI component of Office 2007 for extracting text from TIFF documents. It was working fine untill today when I executed my code it gave the error of "OCR: Bad Language" I have not made any changes in code so in tif documents.I am scanning English documents. mdoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, True, True) ...

How do I make MODI not identify rotated images?

I have a VBScript script that looks like this: Const ForAppending = 8 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile("C:\OCRresults.txt", ForAppending, True) set miDoc=CreateObject("MODI.Document") miDoc.Create ("C:\PathToTifScreenshot.tif") miDoc.Images(0).OCR set miLayout = miDoc.Images(0...

Scanning in .NET using MODI (Microsoft Office Document Imaging)

I'm looking to leverage MS Office scanning functionality in my .NET application. Although I know that MODI COM objects can be accessed in .NET, I'm not sure how to make that. All I need is scanning to file and getting path of that file. I don't need any OCR. ...

How to handle AccessViolationException

I am using a COM object (MODI) from within my .net application. The method I am calling throws a System.AccessViolationException, which is intercepted by Visual Studio. The odd thing is that I have wrapped my call in a try catch, which has handlers for AccessViolationException, COMException and everything else, but when Visual Studio (...

C# - Creating a color tiff file

Hi All, I need to create a colored tiff file from a docx file, as a partial fulfilment for my apllication using C#. I'm using MODI to handle this. What im doing is creating a mdi file first using Microsoft Word API (mdi is color) then save it as a tiff file. But this process associates may I/O operations. Does anyone know a way of u...

C# - Converting .mdi files to jpg, png or bmp

Hi All, I need to convert my .mdi file to jpg, png or bmp. I use MODI for this purpose. I can successfully convert .tiff or .tif files into jpg, png etc using MODI. But is unable to convert the .mdi file. IT throws out an OutOfMemoryExeption when handling .mdi files. Can anyone help me out to solve this problem? I need .mdi file be...