Searching / Hilighting OCR text in Office Document and Imaging

Hi,

I have been given following Tasks using MS Document Imaging 11.0 API

  1. Read TIF perform OCR on it
  2. Show it inAxMODI.AxMiDocView
  3. Searching / highlighting text in AxMODI.AxMiDocView using MODI.MiDocSearch class in TIFF file and Highlight search result in the view.

1,2 are Ok but I have not been able to do point 3. Following Is the code I wrote to searching text in the document and but it is not working

Can anyone comment on this

Loading File

MODI.Document_MODIDocument =newMODI.Document();

_MODIDocument.Create(filename);

axMiDocView1.Document =_MODIDocument;

axMiDocView1.Refresh();

Performing OCR

_MODIDocument.OCR(_MODIParameters.Language,_MODIParameters.WithAutoRotation,_MODIParameters.WithStraightenImage);

Searching Text

MODI.MiDocSearchmodiSearch =newMODI.MiDocSearchClass();

MODI.IMiSelectableItemodiTextSel =null;

objectnum=0,word=0,start=0,back=null;

modiSearch.Initialize(_MODIDocument, "a",refnum,refword,refstart,refback,false, false, false, false);

modiSearch.Search(null,refodiTextSel);

axMiDocView1.MoveSelectionToView(odiTextSel);

Thanks,

Wajhi

[6757 byte] By [wajhi] at [2008-1-9]
# 1

Hi Wajhi,

How can i get the AxMODI to my project? Plz help me out

Regards,

Doppalapudi.

Doppalapudi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 2

Hi,

Please tell me how can i add reference to AxMODI

Please give me reply immedialty....very urgent.

Regards,

Doppalapudi.

Doppalapudi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 3
Hi Doppalapudi,

Visual studio gives error when you try to add axMODI viewer control through drag and drop on your form.
There is a work around to that.Following are the steps for using the AxMODI control in window forms

1. You add reference to the AxMODI activeX component to your project by right clicking to Reference in Visual Studio and in COM or Browse TAB and browse to the following DLL "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MDIVWCTL.DLL"
2. In Windows form first create a reference to the AxMODI Control e.g private AxMODI.AxMiDocView axMiDocView1;
3. In "InitializeComponent()" method add the following lines
1. this.axMiDocView1 = new AxMODI.AxMiDocView();
2. ((System.ComponentModel.ISupportInitialize)(this.axMiDocView1)).BeginInit();
3. this.axMiDocView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.axMiDocView1.Enabled = true;
this.axMiDocView1.Location = new System.Drawing.Point(0, 39);
this.axMiDocView1.Name = "axMiDocView1";
this.axMiDocView1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMiDocView1.OcxState")));
this.axMiDocView1.Size = new System.Drawing.Size(946, 348);
4. save and build and close the form
5. Open the forms designer you will have control available for usage in the designer

There are some good articles/Samples on code project just write MODI in the search of Codeproject.com and you will have good MODI .net samples available in the search results

I hope this solves your problem.

Thanks,
Wajhi Ghumman

wajhi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 4

Hi Wajhi,

Thank you for spending your valuable time and giving valuable suggestions.

Regards,

Doppalapudi.

Doppalapudi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 5

Hi Wajhi,

How can i take reference to MODI and AxMODI?

If i use "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MDIVWCTL.DLL", i am able to see only MODI in references.

How can i get AxMODI? Urgent please..............

Regards,

Doppalapudi.

Doppalapudi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 6

Hi wajhi,

Do u have any idea about, how to connect to a scanner and scan an Image. Is there any Library for this?

Please reply me as early as possibe.

Regards,

Doppalapudi.

Doppalapudi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 7

Hi Doppalapudi,

which IDE you are using and version.

Thanks,

Wajhi

wajhi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 8

Hi Wajhi,

Thank you for giving quick responce.

I am using Visual Studio 2005 IDE and .NET Framework 2.0.

Regards,

Doppalapudi.

Doppalapudi at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 9

Hi Doppalapudi and Wajhi,

Did you ever come to know how to get AxMODI reference? Both VS 2003 and 2005 do not add MODI to the toolbox. How do you create an AxMODI reference?

Thx and Regards,

- Raj

RajL at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 10

Can anyone tell me how I can use a pen and brush on the image. I have a similar situation where I am openeing the TIFF file but, I wish to highlite and circle some of the text using a pen. I am at a loss. All input would be greatly received.

Thanks

koshkosh

KoshKosh at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 11

How to add axMODI to the library?

Thanks,

dchow

dchow at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 12

This external article might be of interest... one of their suggestions is to drop the image into OneNote. From there you might be able to use a digital pen to mark up the image.

http://www.mydigitallife.info/2007/05/13/how-to-open-mdi-microsoft-document-imaging-format-with-office-2007/

-brenda (ISV Buddy Team)

MSISVBuddyTeam at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...
# 13

This external link might be of some help to you regarding adding axMODI:

http://www.codeproject.com/office/modi.asp

-brenda (ISV Buddy Team)

MSISVBuddyTeam at 2007-10-3 > top of Msdn Tech,Microsoft ISV Community Center Forums,ISV Open Discussions...