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)