Aspose.Note FOSS for Python
Эта справка охватывает полную публичную поверхность API aspose-note версии 26.3.1. Экспортируемые из aspose.note пакета документируются здесь. Всё, что находится под aspose.note._internal является деталями реализации и может измениться без предупреждения.
ImageRenderOptions: pip install aspose-note (core) или pip install "aspose-note[pdf]" (с экспортом в PDF)
ImageRenderOptions: from aspose.note import Document, RichText, ...
ImageRenderOptions
Документ и обход
| Class | Description |
|---|---|
AsposeNoteError | Class extending Exception. |
AttachedFile | AttachedFile.FileName holds the optional name of the attached file. |
CompositeNode | CompositeNode.AppendChildLast appends the given node as the last child and returns the added node. |
Document | Document.Save writes the document to a file, stream, or path using the given format or options. |
DocumentVisitor | DocumentVisitor.VisitDocumentStart is invoked when traversal begins a Document node. |
FileCorruptedException | Class extending AsposeNoteError. |
Image | Image.Replace replaces the current image data with the provided Image instance. |
IncorrectDocumentStructureException | Class extending AsposeNoteError. |
IncorrectPasswordException | Class extending AsposeNoteError. |
License | License.SetLicense loads a license from the given file path or binary stream. |
LoadOptions | LoadOptions.DocumentPassword holds the password used to open encrypted documents, or None if not set. |
Metered | Metered.SetMeteredKey stores the provided public and private keys for metered licensing. |
Node | Node.Accept invokes the visitor on this node for traversal or processing. |
NoteTag | NoteTag.CreateYellowStar creates a yellow‑star tag, optionally assigning a label. |
NumberList | NumberList.GetNumberedListHeader returns the header string for the specified list number. |
Outline | Outline.HorizontalOffset represents the horizontal offset of the outline within its container. |
OutlineElement | OutlineElement.NumberList represents the numbered list applied to this outline element, or None if absent. |
Page | Page.Clone creates a copy of the page; if cloneHistory is true the page’s revision history is also copied. |
PageHistory | PageHistory.Add adds the specified Page to the collection. |
ParagraphStyle | ParagraphStyle.Default returns a ParagraphStyle instance initialized with default formatting values. |
RichText | RichText.Append appends the given text with optional style to the end of the rich text. |
Table | Table.Tags provides the collection of NoteTag objects attached to the table. |
TableCell | Class with 7 methods and 4 properties. |
TableColumn | TableColumn.Width represents the column width in points, or None if not set. |
TableRow | Class with 7 methods and 4 properties. |
TextRun | TextRun.Text holds the plain string content of the text run. |
TextStyle | TextStyle.Default returns a TextStyle object representing the library’s default text formatting. |
Title | Title.TitleText holds the RichText representing the title’s main text, or None if absent. |
UnsupportedFileFormatException | UnsupportedFileFormatException.FileFormat represents the file format that triggered the exception. |
UnsupportedSaveFormatException | Class extending AsposeNoteError. |
Структура документа
| Enumeration | Description |
|---|---|
FileFormat | FileFormat.Unknown represents an unspecified or unrecognized file format. |
HorizontalAlignment | HorizontalAlignment.Left represents left horizontal alignment. |
NodeType | NodeType.Document represents a OneNote document node, the root of the DOM hierarchy. |
SaveFormat | SaveFormat.Pdf represents the PDF format used when saving a Document. |
TagStatus | TagStatus.Open represents an open (active) tag status. |
ImageRenderOptions
| Class | Description |
|---|---|
AttachmentTagFlowable | AttachmentTagFlowable.hAlign represents the horizontal alignment setting for the tag flowable. |
OutlinePrefixFlowable | OutlinePrefixFlowable.wrap sets the flowable’s available width and height to aW and aH. |
PdfSaveOptions | PdfSaveOptions.ImageCompression controls the compression algorithm applied to images embedded in the PDF. |
SaveOptions | SaveOptions.SaveFormat specifies the output format for saving the document. |
ImageRenderOptions
Заглушки совместимости
Подробности класса
ImageRenderOptions
Класс корневого документа. Загрузить .one файл из пути к файлу, a pathlib.Path, или бинарный поток.
from aspose.note import Document, LoadOptions
doc = Document(source=None, load_options=None)Параметры конструктора:
ImageRenderOptions:
ImageRenderOptions:
Document.FileFormat примечание: Свойство предоставляет приблизительное указание версии формата файла OneNote. The FileFormat перечисление имеет три значения: OneNote2010, OneNoteOnline, и OneNote2007.
Document.Save() поддержка потоков: target может быть бинарным потоком (io.BytesIO, файловый дескриптор, открытый в режиме бинарной записи, и т.д.). Это подтверждается набором тестов: doc.Save(io.BytesIO(), PdfSaveOptions(SaveFormat.Pdf)).
DocumentVisitor
Абстрактный базовый класс для обхода по шаблону посетителя. Переопределите необходимые вам методы visit:
ImageRenderOptions
Базовый класс для всех узлов дерева документа.
CompositeNode
ImageRenderOptions Node. Добавляет управление дочерними элементами:
ImageRenderOptions
ImageRenderOptions CompositeNode. Представляет страницу OneNote.
ImageRenderOptions:
ImageRenderOptions
ImageRenderOptions CompositeNode. Содержит блок заголовка Page.
ImageRenderOptions
ImageRenderOptions CompositeNode. Позиционный контейнер для OutlineElement узлов.
OutlineElement
ImageRenderOptions CompositeNode. Листовой контейнер, содержащий узлы контента.
RichText
ImageRenderOptions CompositeNode. Блок стилизованного текста.
ImageRenderOptions:
TextRun
ImageRenderOptions Node. Один отформатированный текстовый сегмент.
TextStyle
ImageRenderOptions Node. Свойства форматирования для каждого символа в TextRun.
ImageRenderOptions
ImageRenderOptions CompositeNode. Встроенное изображение.
ImageRenderOptions:
AttachedFile
ImageRenderOptions CompositeNode. Встроенное вложение файла.
ImageRenderOptions
ImageRenderOptions CompositeNode. Таблица внутри OutlineElement.
TableRow
ImageRenderOptions CompositeNode. Строка внутри a Table. Итерация GetChildNodes(TableCell) для доступа к ячейкам.
TableCell
ImageRenderOptions CompositeNode. Ячейка внутри a TableRow. Содержит RichText, Image, и другие узлы контента.
NoteTag
ImageRenderOptions Node. Тег OneNote, прикреплённый к узлу контента.
Примечание к метке времени: created и completed являются необработанными целочисленными метками времени, полученными из двоичного формата MS-ONE, а не datetime объектами.
Фабричные методы:
NumberList
ImageRenderOptions Node. Метаданные нумерованных или маркированных списков в OutlineElement.
LoadOptions
SaveOptions
Базовый класс для всех параметров сохранения. Требуемый позиционный аргумент.
PdfSaveOptions
ImageRenderOptions SaveOptions. Специфическая для PDF конфигурация экспорта. Создайте с помощью PdfSaveOptions(SaveFormat.Pdf).
PageIndex / PageCount предупреждение: Эти поля объявлены в PdfSaveOptions для совместимости API, но Document.Save() реализация в версии v26.3.1 не читает их и не передаёт в PDF‑экспортер. Все страницы всегда экспортируются.
Лицензия и Metered
Экспортированы заглушки совместимости для соответствия форме API Aspose.Note для .NET. Все методы являются пустыми (no‑ops) в этой FOSS‑реализации.
from aspose.note import License, Metered
lic = License()
lic.SetLicense("path/to/license.lic") # no-op
m = Metered()
m.SetMeteredKey("public_key", "private_key") # no-opДля использования любой функции Aspose.Note FOSS для Python ключ лицензии не требуется.
ImageRenderOptions
Полный справочник перечисления: ImageRenderOptions
SaveFormat
FileFormat
Значения перечисления, представляющие версию формата файла OneNote. Document.FileFormat предоставляет максимально возможное указание.
HorizontalAlignment
NodeType
ImageRenderOptions
Полная справка об исключении: ImageRenderOptions