Load / Save Options — Aspose.Note FOSS for Python API Reference
Lớp: LoadOptions
Enumerations: aspose.note Enumerations: from aspose.note import LoadOptions
LoadOptions được truyền vào Document constructor để kiểm soát cách một .one tệp được tải.
Document(source="file.one", load_options=LoadOptions())Enumerations
| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
DocumentPassword | `str | None` | None |
LoadHistory | bool | False | Trường tương thích API; không được sử dụng chức năng trong v26.3.1. |
Enumerations
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)Lớp: SaveOptions (lớp cơ sở)
Enumerations: aspose.note.saving Enumerations: from aspose.note.saving import PdfSaveOptions
SaveOptions là lớp cơ sở trừu tượng cho tất cả các tùy chọn lưu. Nó yêu cầu một SaveFormat là đối số vị trí đầu tiên của nó.
Enumerations
| Enumerations | Enumerations | Enumerations |
|---|---|---|
SaveFormat | SaveFormat | Định dạng đầu ra mục tiêu cho Document.Save() |
Không khởi tạo SaveOptions trực tiếp. Sử dụng một trong các lớp con cụ thể của nó.
Lớp: PdfSaveOptions
Enumerations: aspose.note.saving Enumerations: from aspose.note.saving import PdfSaveOptions Enumerations: SaveOptions
Cấu hình xuất đặc thù cho PDF. Đây là lớp tùy chọn lưu duy nhất mà các tùy chọn của nó được chuyển tiếp tới bộ xuất nền trong v26.3.1.
Khởi tạo với PdfSaveOptions() — không cần đối số.
Enumerations
| Enumerations | Enumerations | Enumerations | Được chuyển tiếp tới exporter | Enumerations |
|---|---|---|---|---|
SaveFormat | SaveFormat | SaveFormat.Pdf | — | Phải là SaveFormat.Pdf |
PageIndex | int | 0 | Enumerations | Được khai báo để tương thích API; không có ảnh hưởng trong v26.3.1 |
PageCount | `int | None` | None | Enumerations |
PageIndex / PageCount cảnh báo: Các trường này tồn tại trong dataclass nhưng không được đọc bởi Document.Save() trong v26.3.1. Tất cả các trang luôn được xuất ra PDF bất kể các giá trị này.
Enumerations
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")Các định dạng lưu nào đã được triển khai?
| Enumerations | Lớp Options | Được triển khai trong v26.3.1 |
|---|---|---|
SaveFormat.Pdf | PdfSaveOptions | Có — yêu cầu pip install "aspose-note[pdf]" |
SaveFormat.One | — | Không — ném UnsupportedSaveFormatException |
Xem Thêm
- Enumerations:
Document.Save()chấp nhận các tùy chọn này - SaveFormat: liệt kê các định dạng đầu ra được hỗ trợ
- UnsupportedSaveFormatException: ném cho các định dạng chưa được triển khai
- Hướng dẫn nhà phát triển xuất PDF