An email leads to a quick discussion on infinite page size in OneNote

I got an email from a fellow writing a OneNote addin that led to our page size being infinite. On one level, this means you can start typing or adding other content to a page and you always get more room to add more content. For most folks that read this blog, this means we get more area to the bottom and the right. For folks that create content in Hebrew, Arabic or Urdu, you would usually see this as a page that gets wider to the left.

On a different level, you can think of the page as having a width (an X value) and a height (a Y value). Nothing out of the ordinary. But since the page size is infinite, you can have these values go negative. In fact, that is how some of the templates create their images to show to the left of the title box.

For instance, you can choose the Academic Template | Lecture and study notes questions, and see a page that looks like this:

clip_image001

Notice how the green image sticks out to the left? A quick look at the page XML shows the negative X coordinate:

  <one:Image format="jpg" backgroundImage="true" originalPageNumber="0" lastModifiedTime="2009-07-28T18:48:52.000Z" objectID="{A4F7B5A6-35D1-4B67-945E-1011EF5677E6}{14}{B0}">

    <one:Position x="-18.0" y="-3.599998235702515" z="0" />

You can programmatically change this to zero and the image will move to the right:

clip_image002

Look closely and you can see the wire from the image is now under the day of the week - it shifted right 18 pixels.

And if you move it to some large negative coordinate, you will get horizontal scroll bars to allow you to scroll to it.

As it turns out, this was an interesting tangent to his original question, but I figured it might be nice to give an example of negative coordinates on our page surface anyway.

Questions, comments, concerns and criticisms always welcome,

John