Aspose.Note 25.6: OneNote content is lost or corrupt after modification using Aspose.Note

We have found an issue with OneNote file after modifying it with Aspose.Note 25.6 and C# .NET Framework 4.8 application.

These are the steps we performed to create a file with multiple sections on SharePoint:

Open OneNote for desktop version 2021.
Selects File → New and choose a folder location on SharePoint.
Create following sections:

  • Drawings.one - the content of this section are only free hand drawings.
  • Equation.one - the content of this section is only a math equation.
  • Files.one - the content of this section are only linked and embedded files.
  • Images.one - the content of this section are only linked web and local images.
  • Tags.one - the content of this section are only OneNote tags.
  • Wiki Section.one - the content of this section is pasted from Wiki page content.

After modifying the file using Aspose.Note 25.6, content of the following sections is either lost or corrupt.

  • Drawings.one - all of the free hand drawings are gone, lost.
  • Equation.one - the math equation is unreadable, like if the font needed is missing.
  • Images.one - the images are there with same size, but it looks like they are zoomed in, the scaling is off.

The modification done in our application is just to add a transparent image on the first page of the document.

The code for the above is:
private static void AddImage(Document doc, byte[] data)
{
Stream stream = new MemoryStream(data);

    var image = new Image(LinkIdsImage.ChunkImageFileName, stream)
    {
        Width = 0,
        Height = 0
    };
	
    Page page = doc.FirstChild;
    if (page == null)
    {
        page = new Page();
        doc.AppendChildLast(page);
    }

    page.AppendChildLast(image);
}

The file is saved using:

using (var outStream = File.OpenWrite(path))
{
document.Save(outStream);
}

We are attaching two zipped files, Original.zip and Modified.zip.

The zipped files contain all of the above-mentioned sections as *.one files.

Can You explain why is the content lost or corrupt?

Modified.zip (3.0 MB)

Original.zip (973.8 KB)

@LinkTek1
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): 125657,291798

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@LinkTek1
Thank you for reporting the issue.

Regarding the free hand drawings: Aspose.Note does not currently support preserving/saving drawings in OneNote documents. We already have this feature planned, and we will update you once it is implemented.

Regarding mathematical formulas: support for formulas in Aspose.Note is currently limited. We also have this area in our future improvement plans and intend to enhance formula handling in upcoming versions.

@denis.kudelin Thanks for the data and for informing us about the plan to handle the data loss in free-hand drawings and mathematical formulas. What about images being scaled incorrectly?

Also, could you give us a list of the components in OneNote files that the most recent version of Aspose.Note does not support currently?

This has been answered in another forum topic:

Thanks! I just responded on the other forum topic. Link: Aspose.Note 25.6: OneNote sync breaks due to metadata loss after modification using Aspose.Note - #25 by LinkTek1

Answered in that topic.

Could you please provide an update on the Aspose.Note issues with IDs 125657 and 291798 reported here?

@LinkTek1
We only had time to fix the issue described here:

Thanks! This is a link to my latest response on that issue.