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

  • Question

  • Hi,

      I am inserting image in OneNote programatically.

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

     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.





    Tuesday, September 20, 2011 6:05 AM


All replies