Insert or Extract Images from OneNote File in C#

Insert Extract Image OneNote

OneNote files are popularly used for taking notes. In certain situations, you might need to extract or insert an image in a OneNote .one document. This article covers how to insert or extract images from a OneNote file using C#.

Insert or Extract Image in OneNote .one File – .NET API Installation

Aspose.Note for .NET API supports creating or editing the OneNote files. You can configure it by downloading the DLL file from the Downloads section or using the below NuGet installation command in Microsoft Visual Studio IDE:

PM>

Insert Image in OneNote .one File in C#

You can insert an image in a OneNote document with the following steps:

  1. Initialize a LoadOptions class object.
  2. Load the input OneNote file with the Document class.
  3. Get the first page of the document with FirstChild property.
  4. Add the image to the page with appendChildLast method.
  5. Finally, save the output OneNote file.

The code snippet below shows how to insert an image in a OneNote .one document using C#:

Extract Images from OneNote .one File using C#

You can extract images from a OneNote file with the following steps:

  1. Firstly, load the input OneNote file with the Document class.
  2. Get all images using GetChildNodes method.
  3. Traverse the list and save output images.

The following code sample explains how to extract images from a OneNote document using C#:

Get Free API License

You can request a free temporary license for evaluating the API without any limitations.

Conclusion

In conclusion, you have learned how to extract or insert image into a OneNote .one file in C#. You can explore several other features of the API by taking a look at the documentation. Furthermore, you can contact us at the free support forum in case of any concerns.

See Also

Print OneNote .one NoteBook File using C#