Enumerations — Aspose.Note FOSS for Python API Reference
Enumerations
Tất cả các kiểu liệt kê được phơi bày trực tiếp từ aspose.note gói:
from aspose.note import SaveFormat, FileFormat, HorizontalAlignment, NodeTypeTất cả các thành viên enum là Python tiêu chuẩn enum.Enum các thể hiện.
SaveFormat
Enumerations: from aspose.note import SaveFormat
Chỉ ra định dạng đầu ra được truyền tới Document.Save().
| Enumerations | Giá trị chuỗi | Trạng thái trong v26.3.1 |
|---|---|---|
SaveFormat.Pdf | "pdf" | Đã triển khai — yêu cầu pip install "aspose-note[pdf]" |
SaveFormat.One | "one" | Chưa triển khai — gây ra UnsupportedSaveFormatException |
Enumerations
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
Enumerations: from aspose.note import FileFormat
Biểu thị phiên bản định dạng tệp OneNote. Được sử dụng bởi Document.FileFormat.
| Enumerations | Giá trị chuỗi | Enumerations |
|---|---|---|
FileFormat.OneNote2010 | "onenote2010" | Định dạng phần chuẩn OneNote 2010 / OneNote cho Windows 10 |
FileFormat.OneNoteOnline | "onenoteonline" | Định dạng OneNote Online |
FileFormat.OneNote2007 | "onenote2007" | Định dạng OneNote 2007 cũ |
Document.FileFormat ghi chú: Cái Document.FileFormat thuộc tính cung cấp một chỉ báo nỗ lực tốt nhất về phiên bản định dạng tệp OneNote.
Enumerations
from aspose.note import Document, FileFormat
doc = Document("MyNotes.one")
if doc.FileFormat == FileFormat.OneNote2010:
print("OneNote 2010 format")HorizontalAlignment
Enumerations: from aspose.note import HorizontalAlignment
Căn chỉnh ngang cho văn bản hoặc đối tượng. Được khai báo để tương thích API; hiện không được áp dụng cho bất kỳ nút nào trong v26.3.1.
| Enumerations | Giá trị chuỗi |
|---|---|
HorizontalAlignment.Left | "left" |
HorizontalAlignment.Center | "center" |
HorizontalAlignment.Right | "right" |
Enumerations
from aspose.note import HorizontalAlignment
alignment = HorizontalAlignment.Left
print(alignment.value) # "left"NodeType
Enumerations: from aspose.note import NodeType
Tên ký hiệu cho các loại nút trong mô hình đối tượng tài liệu. Được khai báo để tương thích API; không được API công cộng sử dụng để xác định nút trong v26.3.1 (sử dụng isinstance kiểm tra hoặc GetChildNodes(Type) thay vào đó).
| Enumerations | Giá trị chuỗi | Lớp tương ứng |
|---|---|---|
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 |
Enumerations
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")Nhận dạng nút ưu tiên: Trong thực tế, hãy sử dụng isinstance(node, RichText) : hoặc page.GetChildNodes(RichText) : thay vì NodeType : so sánh.
Xem Thêm
- Enumerations: tiết lộ
Document.FileFormat - LoadOptions: các tùy chọn thời gian tải
- SaveOptions / PdfSaveOptions: các tùy chọn thời gian lưu
- UnsupportedSaveFormatException: được ném ra cho chưa được triển khai
SaveFormatgiá trị