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.2. |
LoadHistory | bool | False | API 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
| 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 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
| 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.2 |
PageCount | int | None | None | No | Declared for API compatibility; has no effect in v26.2 |
TagIconDir | str | None | None | Yes | Directory containing custom tag icon PNG files (see naming rules in PDF exporter) |
TagIconSize | float | None | None | Yes | Override tag icon size in points |
TagIconGap | float | None | None | Yes | Override horizontal gap around tag icons in points |
PageIndex/PageCountcaveat: These fields exist on the dataclass but are not read byDocument.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
| Property | Type | Default | Description |
|---|---|---|---|
SaveFormat | SaveFormat | — | Set to SaveFormat.One |
DocumentPassword | str | None | None | API 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
| Property | Type | Default | Description |
|---|---|---|---|
SaveFormat | SaveFormat | — | Set to SaveFormat.Html |
PageIndex | int | 0 | API compatibility field; has no effect |
PageCount | int | None | None | API 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
| Property | Type | Default | Description |
|---|---|---|---|
SaveFormat | SaveFormat | — | Set to e.g. SaveFormat.Png, SaveFormat.Jpeg |
PageIndex | int | 0 | API compatibility field; has no effect |
PageCount | int | None | None | API compatibility field; has no effect |
Quality | int | None | None | API compatibility field; has no effect |
Resolution | int | None | None | API compatibility field; has no effect |
Which Save Formats Are Implemented?
| Format | Options class | Implemented in v26.2 |
|---|---|---|
SaveFormat.Pdf | PdfSaveOptions | Yes — requires pip install "aspose-note[pdf]" |
SaveFormat.One | OneSaveOptions | No — raises UnsupportedSaveFormatException |
SaveFormat.Html | HtmlSaveOptions | No — raises UnsupportedSaveFormatException |
SaveFormat.Jpeg, Png, Gif, Bmp, Tiff | ImageSaveOptions | 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