Create a Hello World OneNote document Using API
This article explains how to create a OneNote document from scratch using the simple APIs provided by Aspose.Note for .NET. To create a OneNote document, add page, outline, outline element and text dynamically using the set of classes packaged in the Aspose.Note namespace.
Please follow these steps to create a OneNote document using the Aspose.Note APIs:
- Create an instance of the Document class that represents a OneNote document.
- If you have purchased a license, then embed the code to apply for that license with the help of the License class.
- Initialize one object of Page, Outline, OutlineElement and RichText classes bypassing the Document class object. Calling the AppendChild method of the OutlineElement, Outline, Page and Document classes adds an appropriate new node that can be further used to add new nodes to the OneNote document.
- The ParagraphStyle class defines the text formatting. Similarly, the ParagraphStyle property exposed by RichText class allows applying to format on the text. Text style settings to be used if there is no matching TextStyle object in Styles collection either this object doesn’t specify a needed setting.
- Generate the OneNote document by calling the Save method of the Document object.