We have an issue with our customer’s file after modifying it with Aspose.Note 25.6 and C# .NET Framework 4.8 application.
The customer performed following steps to create a file on SharePoint:
- Opens OneNote for desktop (I don’t know which version)
- Selects File → New and choose a OneDrive location on SharePoint
- Pasted some text in the file and saved it.
- Opened sync status in OneNote application and checked the sync is working.
- The file is created with guidFileFormat: 638de92f-a6d4-4bc1-9a36-b3fc2511a5b7, stands for OneNote Package Store format as per Microsoft documentation.
After modifying the file using Aspose.Note 25.6, the sync breaks with different error codes, some of the meta data content like Author is lost.
The output file remains in OneNote Package Store format, but its internal structure changes substantially: file size shrinks, original content strings disappear and the saved file no longer syncs correctly in SharePoint.
The sync error is Error code: 0xE00001BB ba7uo.
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, SaveFormat.One);
}
We are attaching the original file, v1.0_Untitled Section.one, and the modified one, current_Untitled Section.one.
We have tried to reproduce it on our SharePoint Online using OneNote 2021.
I’ve followed the same steps as the customer (explained above), but our file is created with guidFileFormat: 109add3f-911b-49f5-a5d0-1791edc8aed8, stands for OneNote Revision Store format as per Microsoft documentation.
Can You explain why is this happening only for OneNote Package Store format files?
OneNote Sample Files.zip (5.7 KB)