Load / Save Options

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

PropertyTypeDefaultDescription
DocumentPasswordstr | NoneNoneSetting this value causes IncorrectPasswordException at load time. Encrypted documents are not supported in v26.3.1.
LoadHistoryboolFalseAPI 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

PropertyTypeDescription
SaveFormatSaveFormatThe 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

PropertyTypeDefaultForwarded to exporterDescription
SaveFormatSaveFormatSaveFormat.PdfMust be SaveFormat.Pdf
PageIndexint0NoDeclared for API compatibility; has no effect in v26.3.1
PageCountint | NoneNoneNoDeclared for API compatibility; has no effect in v26.3.1

PageIndex / PageCount caveat: These fields exist on the dataclass but are not read by Document.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?

FormatOptions classImplemented in v26.3.1
SaveFormat.PdfPdfSaveOptionsYes — requires pip install "aspose-note[pdf]"
SaveFormat.OneNo — raises UnsupportedSaveFormatException

See Also