Enumerations

Enumerations — Aspose.Note FOSS for Python API Reference

Properties

การนับจำนวนทั้งหมดถูกเปิดเผยโดยตรงจาก aspose.note แพ็กเกจ:

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

สมาชิก enum ทั้งหมดเป็นมาตรฐาน Python enum.Enum อินสแตนซ์.


SaveFormat

Properties: from aspose.note import SaveFormat

ระบุรูปแบบผลลัพธ์ที่ส่งไปยัง Document.Save().

Propertiesค่า Stringสถานะใน 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ค่า StringProperties
FileFormat.OneNote2010"onenote2010"รูปแบบส่วนมาตรฐานของ OneNote 2010 / OneNote for Windows 10
FileFormat.OneNoteOnline"onenoteonline"รูปแบบ OneNote Online
FileFormat.OneNote2007"onenote2007"รูปแบบ OneNote 2007 รุ่นเก่า

Document.FileFormat หมายเหตุ: ที่ Document.FileFormat property ให้การบ่งชี้โดยประมาณของเวอร์ชันรูปแบบไฟล์ 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ค่า String
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; ไม่ได้ใช้โดย API สาธารณะสำหรับการระบุโหนดใน v26.3.1 (ใช้ isinstance การตรวจสอบหรือ GetChildNodes(Type) แทน).

Propertiesค่า Stringคลาสที่สอดคล้อง
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 การเปรียบเทียบ.


ดูเพิ่มเติม

 ภาษาไทย