Frequently Asked Questions

Frequently Asked Questions

Licensing & Open Source

What license does Aspose.Note FOSS for Python use?

Aspose.Note FOSS for Python is released under the MIT License. You may use, modify, and redistribute the library for any purpose — including commercial applications — without royalties or attribution requirements beyond including the license text.

Can I use this library in a commercial product?

Yes. The MIT License imposes no restrictions on commercial use, redistribution, or modification. There are no runtime fees, usage limits, or subscription requirements.

Where is the source code?

The package is published on PyPI as aspose-note. Install it with:

pip install aspose-note>=26.3.2

Installation & Requirements

How do I install Aspose.Note FOSS for Python?

Install from PyPI using pip:

pip install aspose-note>=26.3.2

Verify the installation:

from aspose.note import Document
print("aspose-note is ready.")

What Python versions are supported?

Aspose.Note FOSS for Python requires Python 3.10 or later. It is pure Python with no compiled extensions, so it runs identically on Windows, macOS, Linux, Docker containers, and serverless functions.

Does it require Microsoft Office or Microsoft OneNote?

No. The library reads OneNote .one files and exports to PDF natively in Python. There is no dependency on Microsoft Office, COM automation, or any Windows-specific API.


Format Support

Which OneNote formats can I read?

The library reads the three OneNote binary variants:

FormatExtensionReadWrite
OneNote 2010.one
OneNote 2007.one
OneNote Online.one
PDF.pdf

Use the FileFormat property on a loaded Document to identify which variant was detected:

from aspose.note import Document

doc = Document("notebook.one")
print(doc.FileFormat)  # e.g. FileFormat.OneNote2010

Can I export OneNote documents to PDF?

Yes. Pass SaveFormat.Pdf as the second argument to Document.Save():

from aspose.note import Document, SaveFormat

doc = Document("notebook.one")
doc.Save("output.pdf", SaveFormat.Pdf)

You can also save to an in-memory buffer by passing a BytesIO object instead of a file path.

Can I save back to the OneNote format?

No. The library reads .one files but only exports to PDF. Calling Document.Save() with a non-PDF format raises UnsupportedSaveFormatException. Use SaveFormat.Pdf for all save operations.


API Usage

How do I load a OneNote file?

Instantiate Document with the file path:

from aspose.note import Document

doc = Document("notebook.one")

Document is the root of the object model. Every Page, Outline, and RichText node in the file is accessible from this root.

How do I iterate over pages and their text content?

Use GetChildNodes() to retrieve typed child nodes at any level of the tree:

from aspose.note import Document, Page, RichText

doc = Document("notebook.one")
for page in doc.GetChildNodes(Page):
    print(f"Page author: {page.Author}")
    for rt in page.GetChildNodes(RichText):
        text = "".join(rt)
        if text.strip():
            print(text)

How do I build a document from scratch?

Construct nodes top-down and attach them with AppendChildLast():

from aspose.note import Document, Page, Outline, RichText, ParagraphStyle, Title, SaveFormat

doc = Document()
page = Page()

title_text = RichText()
title_text.Append("My Page Title", ParagraphStyle())
title = Title()
title.TitleText = title_text
page.Title = title

outline = Outline()
page.AppendChildLast(outline)
doc.AppendChildLast(page)
doc.Save("new_notebook.pdf", SaveFormat.Pdf)

How do I read page metadata such as author and creation time?

Each Page node exposes Author, CreationTime, and LastModifiedTime as properties. The Title node provides TitleText, TitleDate, and TitleTime as RichText children:

from aspose.note import Document, Page

doc = Document("notebook.one")
for page in doc.GetChildNodes(Page):
    print(f"Author  : {page.Author}")
    print(f"Created : {page.CreationTime}")
    if page.Title and page.Title.TitleText:
        print(f"Title   : {page.Title.TitleText}")

Known Limitations

Are there any known limitations I should be aware of?

The current release (26.3.2) focuses on reading OneNote .one files and exporting to PDF. Export to other raster or vector formats (PNG, SVG, HTML) is not available in this FOSS edition.

Can I control PDF export options such as page size or DPI?

PDF is a write-only (export) format — the library saves OneNote content to PDF; PDF is not accepted as an input format. Advanced PDF save options are not exposed in the current API surface. The Document.Save() method with SaveFormat.Pdf produces a default rendering. If you need fine-grained output control, apply further adjustments to the resulting file using a dedicated PDF tool.

Are image dimensions available on image nodes?

Use image.OriginalWidth and image.OriginalHeight to access image dimensions. The Width and Height attribute names do not exist on Image nodes in this release and will raise AttributeError. OriginalWidth and OriginalHeight return float | None.


See Also