Document

Overview

Document is a class in Aspose.Note for Python. Inherits from: CompositeNode.

The Document class can be instantiated with a path to a OneNote .one file to load the document.

Document is a node type in the Aspose.Note for Python document model. It inherits from CompositeNode and forms part of the OneNote document tree hierarchy. It exposes 3 properties and 4 methods. Access instances of this class by traversing a loaded Document object using GetChildNodes() or the visitor pattern.

Properties

NameTypeAccessDescription
FileFormatFileFormatReadReturns a FileFormat enum value that identifies the OneNote version (OneNote2010, OneNoteOnline, OneNote2007, or Unknown)
CreationTimedatetime | NoneReadThe date and time when the document was first created, or None if not recorded
DisplayNamestr | NoneReadThe display name of the document, or None if not set

Methods

SignatureDescription
__init__(source: str | Path | BinaryIO | None, load_options: LoadOptions | None)
DetectLayoutChanges()Detects changes in page layout and updates internal structures
GetPageHistory(page: Page)PageHistoryReturns a PageHistory object representing the edit history of the given page
Save(target: str | Path | BinaryIO, format_or_options: SaveFormat | SaveOptions | None)Writes the document to a target path and accepts a format identifier such as SaveFormat.Pdf to export the document as a PDF file