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.2.
LoadHistoryboolFalseAPI compatibility field; not functionally used in v26.2.

Example

from aspose.note import Document, LoadOptions

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

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

Class: SaveOptions (base class)

Package: aspose.note.saving Import: from aspose.note import PdfSaveOptions, OneSaveOptions, HtmlSaveOptions, ImageSaveOptions

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 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.2.

Construct with PdfSaveOptions(SaveFormat.Pdf).

Properties

PropertyTypeDefaultForwarded to exporterDescription
SaveFormatSaveFormatSaveFormat.PdfMust be SaveFormat.Pdf
PageIndexint0NoDeclared for API compatibility; has no effect in v26.2
PageCountint | NoneNoneNoDeclared for API compatibility; has no effect in v26.2
TagIconDirstr | NoneNoneYesDirectory containing custom tag icon PNG files (see naming rules in PDF exporter)
TagIconSizefloat | NoneNoneYesOverride tag icon size in points
TagIconGapfloat | NoneNoneYesOverride horizontal gap around tag icons in points

PageIndex / PageCount caveat: These fields exist on the dataclass but are not read by Document.Save() in v26.2. All pages are always exported to PDF regardless of these values.

Examples

from aspose.note import Document, PdfSaveOptions, SaveFormat

doc = Document("MyNotes.one")

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

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

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

##Export with custom tag icons
doc = Document("MyNotes.one")
opts = PdfSaveOptions(SaveFormat.Pdf)
opts.TagIconDir = "/path/to/icons"
opts.TagIconSize = 16.0
opts.TagIconGap = 2.0
doc.Save("output-with-icons.pdf", opts)

Class: OneSaveOptions

Package: aspose.note.saving Import: from aspose.note import OneSaveOptions Inherits: SaveOptions

Declared for API compatibility with Aspose.Note for .NET. Attempting to save with this class raises UnsupportedSaveFormatException.

Properties

PropertyTypeDefaultDescription
SaveFormatSaveFormatSet to SaveFormat.One
DocumentPasswordstr | NoneNoneAPI compatibility field; has no effect

Class: HtmlSaveOptions

Package: aspose.note.saving Import: from aspose.note import HtmlSaveOptions Inherits: SaveOptions

Declared for API compatibility with Aspose.Note for .NET. Attempting to save with this class raises UnsupportedSaveFormatException.

Properties

PropertyTypeDefaultDescription
SaveFormatSaveFormatSet to SaveFormat.Html
PageIndexint0API compatibility field; has no effect
PageCountint | NoneNoneAPI compatibility field; has no effect

Class: ImageSaveOptions

Package: aspose.note.saving Import: from aspose.note import ImageSaveOptions Inherits: SaveOptions

Declared for API compatibility with Aspose.Note for .NET. Attempting to save with this class raises UnsupportedSaveFormatException.

Properties

PropertyTypeDefaultDescription
SaveFormatSaveFormatSet to e.g. SaveFormat.Png, SaveFormat.Jpeg
PageIndexint0API compatibility field; has no effect
PageCountint | NoneNoneAPI compatibility field; has no effect
Qualityint | NoneNoneAPI compatibility field; has no effect
Resolutionint | NoneNoneAPI compatibility field; has no effect

Which Save Formats Are Implemented?

FormatOptions classImplemented in v26.2
SaveFormat.PdfPdfSaveOptionsYes — requires pip install "aspose-note[pdf]"
SaveFormat.OneOneSaveOptionsNo — raises UnsupportedSaveFormatException
SaveFormat.HtmlHtmlSaveOptionsNo — raises UnsupportedSaveFormatException
SaveFormat.Jpeg, Png, Gif, Bmp, TiffImageSaveOptionsNo — raises UnsupportedSaveFormatException

See Also