ONETOC2 File Viewer for .NET

ONETOC2 file without any dependency over Microsoft OneNote application.

 

How to View ONETOC2 File Using C#

In order to view ONETOC2 file, we’ll use

Aspose.Note for .NET

API which is a feature-rich, powerful and easy to use API for C# platform to be used with any Viewer. Open

NuGet

package manager, search for Aspose.Note and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command

PM> Install-Package Aspose.Note

Steps to View ONETOC2 via C#

Aspose.Note makes it easy for the developers to view the one file with just few lines of code.

  1. Load one file with Document class
  2. Call the Document.Save method
  3. Pass output file path & SaveFormat.Html as parameters

System Requirements

Aspose.Note for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.

  1. Microsoft Windows or a compatible OS with .NET Framework, .NET Core
  2. Development environment like Microsoft Visual Studio
  3. Aspose.Note for .NET referenced in your project

Aspose.Note API handles Microsoft OneNote file formats without Microsoft OneNote dependencies. ONETOC2 can easily load, create, modify and convert Microsoft OneNote files. Moreover, ONETOC2 can manipulate the elements of OneNote books, render text and images from OneNote file to different formats.

 

What is a .ONETOC2 files

The .onetoc2 file extension is associated with the Microsoft OneNote application, which is a program with which you can take notes. Notes from the OneNote app can be shared with other users, and you can organize them and perform other actions. Documents associated with this software have the .onetoc2 extension. It is worth noting that these files can store not only text, but also images, as well as animation and video.

How to read the .ONETOC2 file extension?

To read the .onetoc2 file you need to have special software. it can be either a Microsoft Office 365 package, and you are required to have a Microsoft Office account. Depending on the operating system you are using, be it Mac, Windows or Linux, you may be able to install additional software that will help you open .onetoc2 files on your PC. But if you work in a corporation or in another institution where additional software cannot be installed on your PC, then the Aspos application will help you. First, it’s free. Secondly, it does not require installation on your PC. All operations for viewing .onetoc2 files you can do online. And if necessary, you can use our other applications and convert ONETOC2 files to other formats.

Free App to View ONE

 

C# code to view ONETOC2

string output = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".html";

// load the OneNote ONETOC2 file
var document = new Aspose.Note.Document("template.onetoc2");

// create HtmlSaveOptions and set export options
var options = new Aspose.Note.Saving.HtmlSaveOptions()
{
    ExportCss = Aspose.Note.Saving.Html.ResourceExportType.ExportEmbedded,
    ExportFonts = Aspose.Note.Saving.Html.ResourceExportType.ExportEmbedded,
    ExportImages = Aspose.Note.Saving.Html.ResourceExportType.ExportEmbedded
};

// save OneNote ONETOC2 in HTML format
document.Save(output, options);

// load resultant HTML in default browser
System.Diagnostics.Process.Start(output);

Other Viewer Options