OneNote 2007 API - Data within InkWords Not loadable by MS Ink class

B

benmca

Hi -

I'm trying to query for ink in a certain region of a page within
OneNote. My query works ok, and I end up iterating through InkWords,
gathering ink as I go. My strategy was to build a primary Ink object,
adding ink from each InkWord to it as I go. Some pseudocode:

XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns);
Ink ink = new Ink();
foreach(XmlNode node in dataNodes)
{
string encodedInk = node.InnerText;
Ink tempInk = DecodeInk(encodedInk);
primaryInk.AddStrokesAtRectangle(s, r);
}

Within Decode Ink, I do the following:

Ink ink = new Ink();
ink.Load(Convert.FromBase64String(encodedInk));
return ink;

The problem is this: When I call Ink.Load, the ink object throws an
exception:

Catastrophic failure (Exception from HRESULT: 0x8000FFFF
(E_UNEXPECTED))

As far as I know, this only happens when the ink is in a format which
the Ink object does not understand. I tried changing my ink.Load call
to
ink.Load("base64:" + Convert.FromBase64String(encodedInk));
....but got the same result.

Is the Ink for an InkDrawing encoded differently after IA (conversion
to InkWord)? I noticed a difference in the data, but assumed it was
normalizing strokes or something, no re-encoding data. Thanks for any
help!

Ben
 
I

Ilya Koulchin

Does this happen for all InkWords, or just some of them? Could you post
the ISF for some of the ink that fails to load?
Also, what version of the framework are you using?

Ilya
 
B

benmca

It was an issue in my code - A bad xpath query led to erroneously
trying to load data from an image instead of InkWord etc. I'll post
again once I get to the InkWord loading. Thanks for the support
guys!

b
 
Top