How to programmatically insert an Outline element..?

X

xiao

Question: How to programmatically insert an Outline element with an
InkDrawing node?

Hi All,
I need to programmatically insert an InkDrawing node.
However, after I inserted the InkDrawing node, OneNote automatically merged
it with ink strokes nearby. This feature is not good for my app.

So I try to insert an Outline element with the InkDrawing node. According to
my experience, OneNote would not automatically merge the ink strokes in an
Outline element with other ink strokes.

After I inserted the Outline element (with an InkDrawing node), the
InkDrawing node does not have attributes like inkOriginX, inkOriginY, even
though they are set in my program.

Also, OneNote does not automatically recognize the ink in the Outline
element. In other words, I can't search text in this element.

Is it a correct assumption that we can programmatically import an Outline
element with an InkDrawing node so that it won't be merged with nearby ink?
And I still want OneNote to recognize the InkDrawing to support searching.
Any suggestions?
Thx.
 
I

Ilya Koulchin

xiao said:
After I inserted the Outline element (with an InkDrawing node), the
InkDrawing node does not have attributes like inkOriginX, inkOriginY, even
though they are set in my program.

OneNote may rearrange the internal representations of the strokes
comprising the ink drawing. If that results in inkOriginX and inkOriginY
being set to their default values, the attributes will not be
re-exported. Does the drawing render as you expect?
Also, OneNote does not automatically recognize the ink in the Outline
element. In other words, I can't search text in this element.

OneNote will not automatically recognize any ink that is imported
directly into an outline. If you want OneNote to run handwriting
recognition you will need to import your ink as unclassified ink
directly onto the page.
Is it a correct assumption that we can programmatically import an Outline
element with an InkDrawing node so that it won't be merged with nearby ink?

The best approach for importing ink within outline elements is to only
import it in an OE if it was exported that way by OneNote. The
recommended approach for importing ink is to import it as unclassified
ink directly onto the page, which will generally be the easiest to get
to render correctly, and allow OneNote's ink recognition features to run

Ilya
 
X

xiao

Thanks, Ilya.
More questions:)

Ilya Koulchin said:
OneNote may rearrange the internal representations of the strokes
comprising the ink drawing. If that results in inkOriginX and inkOriginY
being set to their default values, the attributes will not be
re-exported. Does the drawing render as you expect?

The drawing is rendered correctly. I appended the InkDrawing node to an OE
node -> an OEChildren node -> an Outline node. However, the attributes I set
disappear after OneNote's rearrangement. For example, I set inkOriginX,
inkOriginY and set isUnclassified=true. After I import ink, the above three
attributes do not show up in the InkDrawing node. I think that's why OneNote
does not run recognition on this inkdrawing node.
OneNote will not automatically recognize any ink that is imported
directly into an outline. If you want OneNote to run handwriting
recognition you will need to import your ink as unclassified ink
directly onto the page.

Unfortunately, if I import my ink as unclassfied ink, OneNote will merge it
with ink nearby.
The best approach for importing ink within outline elements is to only
import it in an OE if it was exported that way by OneNote. The
recommended approach for importing ink is to import it as unclassified
ink directly onto the page, which will generally be the easiest to get
to render correctly, and allow OneNote's ink recognition features to run

My goal is to Tag my ink for example as "To do". That's why I don't want the
ink be merged with other ink strokes. Is it possible to Tag some ink strokes,
imported it as unclassified ink and set some attributes so that OneNote won't
automatically merged it with other ink.
Thanks.
 
I

Ilya Koulchin

xiao said:
I set inkOriginX,
inkOriginY and set isUnclassified=true. After I import ink, the above three
attributes do not show up in the InkDrawing node. I think that's why OneNote
does not run recognition on this inkdrawing node.

The isUnclassified attribute is used only for ink that is on the page.
If the ink is inserted into an outline the isUnclassified attribute will
be ignored and handwriting recognition will not be run.
My goal is to Tag my ink for example as "To do". That's why I don't want the
ink be merged with other ink strokes. Is it possible to Tag some ink strokes,
imported it as unclassified ink and set some attributes so that OneNote won't
automatically merged it with other ink.

You can add tags to the ink when you're importing it. If you want to tag
a group of ink strokes, import all the strokes as a single drawing with
a notetag already applied to it.

Ilya
 
X

xiao

You can add tags to the ink when you're importing it. If you want to tag
a group of ink strokes, import all the strokes as a single drawing with
a notetag already applied to it.

What I did is:
1. create an InkDrawing node (N1)
2. append a tag node to the InkDrawing node (N1)
3. create a data node with all ink strokes
4. append the data node to the InkDrawing node (N1)
5. create another InkDrawing node (N2) that has ink strokes but does not
have Tag

I can successfully import both InkDrawing nodes. N1 has a tag. However,
right after I import the InkDrawing nodes, OneNote tries to merge ink
strokes. Actually OneNote rearranges the Tag Node. The new Tag consists of a
part of ink strokes of N1 and a part of ink strokes of N2, which is wrong.

Is there a way to disable this background merging? Or did I do something
wrong?
Thx.
 
I

Ilya Koulchin

xiao said:
What I did is:
1. create an InkDrawing node (N1)
2. append a tag node to the InkDrawing node (N1)
3. create a data node with all ink strokes
4. append the data node to the InkDrawing node (N1)
5. create another InkDrawing node (N2) that has ink strokes but does not
have Tag

I can successfully import both InkDrawing nodes. N1 has a tag. However,
right after I import the InkDrawing nodes, OneNote tries to merge ink
strokes. Actually OneNote rearranges the Tag Node. The new Tag consists of a
part of ink strokes of N1 and a part of ink strokes of N2, which is wrong.

Could you post a sample XML that you're trying to import, along with a
sample XML of what OneNote exports after you import your XML?

Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top