Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

OneNote is not giving OCRText for (programatically) inserted image in OneNote 2007.How to force onenote to do OCR on Image?

$
0
0

Hi,

  I am inserting image in OneNote programatically.

//Get the bytes of the imagebyte[] fileBytes = File.ReadAllBytes(@"image directory");//Convert them to a base64 stringstring fileString = Convert.ToBase64String(fileBytes);//XML string to addstring toAdd = @"<one:Image><one:Data>" + fileString + @"</one:Data></one:Image>";

 Image is getting inserted in page of OneNote2007. Then i am navigating to that page.So page gets opened in OneNote, i can see image inserted in it. Giving enough time to OneNote to do OCR.

Now i am opening another program writtten by me for getting OCR from current opened page. using...

onApp.GetPageContent(strActivePageID,out strXML4, OneNote.PageInfo.piBinaryData);


But it is not giving OCR for Programatically inserted image. For manually inserted image i can get OCRText.

One more strange thing-

   If i inserted image programatically and run the program for getting OCR data, OCRText is not comming.

Now if go to oneNote and do right click on programatically inserted image -> "Copy text from image". One progressbar is coming saying 'copying text from image'.

  Now if run the program for getting OCR data again, Result is coming and showing OCR data as output !!!!

Will anyone please guide me.I am trying this since last many days.

Regards,

Sachin.

 

 


Viewing all articles
Browse latest Browse all 2257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>