Save a OneNote Document

Saving a Document to OneNote Format

How does it work?

The save method exposed by the API lets you save the document to OneNote format. The following three overloaded members provide the option to save the document in OneNote format.

  • save(string)
  • save(string, OneSaveOptions)
  • save(string, SaveFormat)

Saving a Document Using Save Options

Saving a Document Using Save Format

Save OneNote Document to a Stream

Users can pass a stream object to the Document.save(Stream, SaveFormat) method. When saving to a stream, you must specify the save format explicitly.

Specify OneNote Save Options

There are overloaded Document.save methods that accept a SaveOptions object. This should be an object of a class derived from the SaveOptions class. Each save format has a corresponding class that holds save options for that format. For example, there is PdfSaveOptions for SaveFormat.Pdf and OneSaveOptions for SaveFormat.One.

The code below shows how to set save options before saving a document to PDF.

Working with Locales

Aspose.Note provides an opportunity to set locales using setLocale method under LocaleOptions class.

The code below shows how to set locales options before saving a document.