Load / Save Options — Aspose.Note FOSS for Python API Reference
Class: LoadOptions
Package: aspose.note
Import: from aspose.note import LoadOptions
LoadOptions is passed to the Document constructor to control how a .one file is loaded.
Document(source="file.one", load_options=LoadOptions())Properties
| Property | Type | Default | Description |
|---|---|---|---|
DocumentPassword | str | None | None | Setting this value causes IncorrectPasswordException at load time. Encrypted documents are not supported in v26.3.1. |
LoadHistory | bool | False | API compatibility field; not functionally used in v26.3.1. |
Example
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)Class: SaveOptions (base class)
Package: aspose.note.saving
Import: from aspose.note.saving import PdfSaveOptions
SaveOptions is the abstract base class for all save options. It requires a SaveFormat as its first positional argument.
Properties
| Property | Type | Description |
|---|---|---|
SaveFormat | SaveFormat | The target output format for Document.Save() |
Do not instantiate SaveOptions directly. Use one of its concrete subclasses.
Class: PdfSaveOptions
Package: aspose.note.saving
Import: from aspose.note.saving import PdfSaveOptions
Inherits: SaveOptions
PDF-specific export configuration. This is the only save options class whose options are forwarded to the underlying exporter in v26.3.1.
Construct with PdfSaveOptions() — no arguments required.
Properties
| Property | Type | Default | Forwarded to exporter | Description |
|---|---|---|---|---|
SaveFormat | SaveFormat | SaveFormat.Pdf | — | Must be SaveFormat.Pdf |
PageIndex | int | 0 | No | Declared for API compatibility; has no effect in v26.3.1 |
PageCount | int | None | None | No | Declared for API compatibility; has no effect in v26.3.1 |
PageIndex/PageCountcaveat: These fields exist on the dataclass but are not read byDocument.Save()in v26.3.1. All pages are always exported to PDF regardless of these values.
Examples
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")Which Save Formats Are Implemented?
| Format | Options class | Implemented in v26.3.1 |
|---|---|---|
SaveFormat.Pdf | PdfSaveOptions | Yes — requires pip install "aspose-note[pdf]" |
SaveFormat.One | — | No — raises UnsupportedSaveFormatException |
See Also
- Document:
Document.Save()accepts these options - SaveFormat: enumeration of supported output formats
- UnsupportedSaveFormatException: raised for unimplemented formats
- PDF Export Developer Guide