Enumerations — Aspose.Note FOSS for Python API Reference

Enumerations

All enumerations are exposed directly from the aspose.note package:

from aspose.note import SaveFormat, FileFormat, HorizontalAlignment, NodeType

All enum members are standard Python enum.Enum instances.


SaveFormat

Import: from aspose.note import SaveFormat

Indicates the output format passed to Document.Save().

MemberString valueStatus in v26.2
SaveFormat.Pdf"pdf"Implemented — requires pip install "aspose-note[pdf]"
SaveFormat.One"one"Not implemented — raises UnsupportedSaveFormatException
SaveFormat.Html"html"Not implemented — raises UnsupportedSaveFormatException
SaveFormat.Jpeg"jpeg"Not implemented — raises UnsupportedSaveFormatException
SaveFormat.Png"png"Not implemented — raises UnsupportedSaveFormatException
SaveFormat.Gif"gif"Not implemented — raises UnsupportedSaveFormatException
SaveFormat.Bmp"bmp"Not implemented — raises UnsupportedSaveFormatException
SaveFormat.Tiff"tiff"Not implemented — raises UnsupportedSaveFormatException

Usage

from aspose.note import Document, SaveFormat

doc = Document("MyNotes.one")

##Save to PDF (implemented)
doc.Save("output.pdf", SaveFormat.Pdf)
from aspose.note import SaveFormat

##Iterate all members
for fmt in SaveFormat:
    print(fmt.name, fmt.value)

FileFormat

Import: from aspose.note import FileFormat

Represents the OneNote file format version. Used by Document.FileFormat.

MemberString valueNotes
FileFormat.OneNote2010"onenote2010"Standard OneNote 2010 / OneNote for Windows 10 section format
FileFormat.OneNoteOnline"onenoteonline"OneNote Online format
FileFormat.OneNote2007"onenote2007"Legacy OneNote 2007 format

Document.FileFormat note: In v26.2 this property always returns FileFormat.OneNote2010 regardless of the actual file content. Format detection is not yet implemented.

Usage

from aspose.note import Document, FileFormat

doc = Document("MyNotes.one")
if doc.FileFormat == FileFormat.OneNote2010:
    print("OneNote 2010 format")

HorizontalAlignment

Import: from aspose.note import HorizontalAlignment

Text or object horizontal alignment. Declared for API compatibility; not currently applied to any node in v26.2.

MemberString value
HorizontalAlignment.Left"left"
HorizontalAlignment.Center"center"
HorizontalAlignment.Right"right"

Usage

from aspose.note import HorizontalAlignment

alignment = HorizontalAlignment.Left
print(alignment.value)  # "left"

NodeType

Import: from aspose.note import NodeType

Symbolic names for the node types in the document object model. Declared for API compatibility; not used by the public API for node identification in v26.2 (use isinstance checks or GetChildNodes(Type) instead).

MemberString valueCorresponding class
NodeType.Document"document"Document
NodeType.Page"page"Page
NodeType.Outline"outline"Outline
NodeType.OutlineElement"outline_element"OutlineElement
NodeType.RichText"rich_text"RichText
NodeType.Image"image"Image
NodeType.Table"table"Table
NodeType.AttachedFile"attached_file"AttachedFile

Usage

from aspose.note import NodeType

##Inspect all members
for nt in NodeType:
    print(nt.name, "->", nt.value)
from aspose.note import NodeType

##Compare by value string
node_type_value = "rich_text"
if node_type_value == NodeType.RichText.value:
    print("This is a RichText node type")

Preferred node identification: In practice, use isinstance(node, RichText) or page.GetChildNodes(RichText) rather than NodeType comparisons.


See Also