Enumerations

Enumerations — Aspose.Note FOSS for Python API Reference

Properties

所有枚举都直接从 aspose.note 包::

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

所有枚举成员都是标准 Python enum.Enum 实例。.


SaveFormat

Properties: from aspose.note import SaveFormat

指示传递给的输出格式 Document.Save().

Properties字符串值v26.3.1 中的状态
SaveFormat.Pdf"pdf"已实现 — 需要 pip install "aspose-note[pdf]"
SaveFormat.One"one"未实现 — 抛出 UnsupportedSaveFormatException

Properties

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

Properties: from aspose.note import FileFormat

表示 OneNote 文件格式版本。由 Document.FileFormat.

Properties字符串值Properties
FileFormat.OneNote2010"onenote2010"标准 OneNote 2010 / OneNote for Windows 10 部分格式
FileFormat.OneNoteOnline"onenoteonline"OneNote Online 格式
FileFormat.OneNote2007"onenote2007"旧版 OneNote 2007 格式

Document.FileFormat 笔记: 该 Document.FileFormat 属性提供对 OneNote 文件格式版本的尽力指示。.

Properties

from aspose.note import Document, FileFormat

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

HorizontalAlignment

Properties: from aspose.note import HorizontalAlignment

文本或对象的水平对齐。为 API 兼容性而声明;在 v26.3.1 中未实际应用于任何节点。.

Properties字符串值
HorizontalAlignment.Left"left"
HorizontalAlignment.Center"center"
HorizontalAlignment.Right"right"

Properties

from aspose.note import HorizontalAlignment

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

NodeType

Properties: from aspose.note import NodeType

文档对象模型中节点类型的符号名称。为 API 兼容性声明;在 v26.3.1 中未被公共 API 用于节点标识(使用 isinstance 检查或 GetChildNodes(Type) 而不是)。.

Properties字符串值对应的类
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

Properties

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")

首选节点标识: 在实践中,使用 isinstance(node, RichText)page.GetChildNodes(RichText) 而不是 NodeType 比较。.


另见

 中文