Convert onenote to png or jpeg

Dear sir,

I want to make sure that a OneNote File (*.one) is not editable. Hence, it would be nice to convert the File to either JPEG or PNG. I need a vb.net code on Windows Forms(vb) that will convert a given OneNote File and possibly keep the converted File in the same location automatically. The conversion should be a background process. The sub should just accept the File Name, convert the File and keep the converted File in the same location with the same name.

Thanks.

Regds,

Emmanuel Addah

@emmaddah,
You may convert the *.one file to image using following sample code:

// Load the document into Aspose.Note.
Aspose.Note.Document oneFile = new Aspose.Note.Document(dataDir + "Section 1.one");

// Initialize ImageSaveOptions object 
Aspose.Note.Saving.ImageSaveOptions opts = new Aspose.Note.Saving.ImageSaveOptions(Aspose.Note.SaveFormat.Png);

// Set page index
opts.PageIndex = 0;

// Save the document as PNG.
oneFile.Save(dataDir + "Section01Page01.png", opts);

Regarding making the *.one file read only, I could not find any option using Microsoft OneNote and Aspose.Note as well. Could you please explain this requirement and provide steps to perform same task using MS OneNote? It will help us to observe this feature and provide alternate solution using Aspose.Note.

Thanks a lot for your prompt reply. Now, I have changed my mind. I realized that if I convert to JPEG, it will be difficult to organize multiple converted images, unlike a pdf file. Hence I would like the OneNote File to be converted to pdf. It should be a OneNote package (.package) File that is being converted to pdf. When I exported the OneNote package to pdf, I got a nice result. All the sections are exported to form different pages in the pdf File.

Now, I need a code, with the aspose component that will convert the OneNote package to pdf directly, without open any File , i.e., no manual conversion with another software.

Thanks.

@emmaddah,

You can convert OneNote format file to PDF. See the document with example code for your reference:

Converting OneNote Document to PDF

Hope, this helps a bit.