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, NodeTypeAll enum members are standard Python enum.Enum instances.
SaveFormat
Import: from aspose.note import SaveFormat
Indicates the output format passed to Document.Save().
| Member | String value | Status 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.
| Member | String value | Notes |
|---|---|---|
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.FileFormatnote: In v26.2 this property always returnsFileFormat.OneNote2010regardless 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.
| Member | String 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).
| Member | String value | Corresponding 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)orpage.GetChildNodes(RichText)rather thanNodeTypecomparisons.
See Also
- Document: exposes
Document.FileFormat - LoadOptions: load-time options
- SaveOptions / PdfSaveOptions: save-time options
- UnsupportedSaveFormatException: raised for unimplemented
SaveFormatvalues