Load / Save Options

Load / Save Options — Aspose.Note FOSS for Python API Reference

คลาส: LoadOptions

Properties: aspose.note Properties: from aspose.note import LoadOptions

LoadOptions จะถูกส่งไปยัง Document คอนสตรัคเตอร์เพื่อควบคุมวิธีการที่ .one ไฟล์ถูกโหลด.

Document(source="file.one", load_options=LoadOptions())

Properties

PropertiesPropertiesPropertiesProperties
DocumentPassword`strNone`None
LoadHistoryboolFalseฟิลด์ความเข้ากันได้ของ API; ไม่ได้ใช้ในเชิงฟังก์ชันใน v26.3.1.

Properties

from aspose.note import Document, LoadOptions

opts = LoadOptions()
opts.LoadHistory = False  # no-op in v26.3.1, kept for .NET API compatibility

doc = Document("MyNotes.one", opts)

คลาส: SaveOptions (คลาสฐาน)

Properties: aspose.note.saving Properties: from aspose.note.saving import PdfSaveOptions

SaveOptions เป็นคลาสฐานเชิงนามธรรมสำหรับตัวเลือกการบันทึกทั้งหมด. จำเป็นต้องมี SaveFormat เป็นอาร์กิวเมนต์ตำแหน่งแรก.

Properties

PropertiesPropertiesProperties
SaveFormatSaveFormatรูปแบบผลลัพธ์เป้าหมายสำหรับ Document.Save()

ห้ามสร้างอินสแตนซ์ SaveOptions โดยตรง. ใช้หนึ่งในซับคลาสที่เป็นคอนกรีตของมัน.


คลาส: PdfSaveOptions

Properties: aspose.note.saving Properties: from aspose.note.saving import PdfSaveOptions Properties: SaveOptions

การกำหนดค่าการส่งออกเฉพาะ PDF นี่เป็นคลาสตัวเลือกการบันทึกเพียงคลาสเดียวที่ตัวเลือกของมันถูกส่งต่อไปยังตัวส่งออกพื้นฐานใน v26.3.1.

สร้างด้วย PdfSaveOptions() — ไม่ต้องการอาร์กิวเมนต์.

Properties

PropertiesPropertiesPropertiesส่งต่อไปยังผู้ส่งออกProperties
SaveFormatSaveFormatSaveFormat.Pdfต้องเป็น SaveFormat.Pdf
PageIndexint0Propertiesประกาศเพื่อความเข้ากันได้ของ API; ไม่มีผลใน v26.3.1
PageCount`intNone`NoneProperties

PageIndex / PageCount ข้อจำกัด: ฟิลด์เหล่านี้มีอยู่ใน dataclass แต่ไม่ได้ถูกอ่านโดย Document.Save() ใน v26.3.1. ทุกหน้าได้รับการส่งออกเป็น PDF เสมอโดยไม่คำนึงถึงค่าต่าง ๆ เหล่านี้.

Properties

from aspose.note import Document, SaveFormat
from aspose.note.saving import PdfSaveOptions

doc = Document("MyNotes.one")

##Basic PDF export
doc.Save("output.pdf", SaveFormat.Pdf)

##Using PdfSaveOptions
opts = PdfSaveOptions()
doc.Save("output.pdf", opts)
import io
from aspose.note import Document, SaveFormat
from aspose.note.saving import PdfSaveOptions

##Export to an in-memory buffer
doc = Document("MyNotes.one")
buf = io.BytesIO()
opts = PdfSaveOptions()
doc.Save(buf, opts)
pdf_bytes = buf.getvalue()
print(f"PDF size: {len(pdf_bytes)} bytes")

รูปแบบการบันทึกที่มีการสนับสนุนคืออะไร?

Propertiesคลาส Optionsนำไปใช้ใน v26.3.1
SaveFormat.PdfPdfSaveOptionsใช่ — ต้องการ pip install "aspose-note[pdf]"
SaveFormat.Oneไม่ — ยกข้อยกเว้น UnsupportedSaveFormatException

ดูเพิ่มเติม

 ภาษาไทย