Aspose.Note FOSS for Python
Esta referencia cubre la superficie completa de la API pública de aspose-note versión 26.3.1. Sólo los símbolos exportados desde el aspose.note paquete se documentan aquí. Cualquier cosa bajo aspose.note._internal es un detalle de implementación y puede cambiar sin previo aviso.
Examples: pip install aspose-note (core) o pip install "aspose-note[pdf]" (con exportación a PDF)
Examples: from aspose.note import Document, RichText, ...
Examples
Documento y Recorrido
| 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. |
Estructura del Documento
| 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. |
Examples
| 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. |
Examples
Stubs de compatibilidad
Detalles de la Clase
Examples
La clase de documento raíz. Cargar un .one archivo desde una ruta de archivo, un pathlib.Path, o un flujo binario.
from aspose.note import Document, LoadOptions
doc = Document(source=None, load_options=None)Parámetros del constructor:
Examples:
Examples:
Document.FileFormat nota: La propiedad proporciona una indicación de mejor esfuerzo de la versión del formato de archivo OneNote. La FileFormat enumeración tiene tres valores: OneNote2010, OneNoteOnline, y OneNote2007.
Document.Save() soporte de flujo: target puede ser un flujo binario (io.BytesIO, controlador de archivo abierto en modo de escritura binaria, etc.). Esto está confirmado por el conjunto de pruebas: doc.Save(io.BytesIO(), PdfSaveOptions(SaveFormat.Pdf)).
DocumentVisitor
Clase base abstracta para el recorrido con patrón visitor. Sobrescribe los métodos de visita que necesites:
Examples
Clase base para todos los nodos del árbol de documentos.
CompositeNode
Examples Node. Añade gestión de hijos:
Examples
Examples CompositeNode. Representa una página de OneNote.
Examples:
Examples
Examples CompositeNode. Contiene el bloque de título de un Page.
Examples
Examples CompositeNode. Un contenedor posicional para OutlineElement nodos.
OutlineElement
Examples CompositeNode. Un contenedor hoja que contiene nodos de contenido.
RichText
Examples CompositeNode. Un bloque de texto con estilo.
Examples:
TextRun
Examples Node. Un único segmento de texto formateado.
TextStyle
Examples Node. Propiedades de formato por carácter para un TextRun.
Examples
Examples CompositeNode. Una imagen incrustada.
Examples:
AttachedFile
Examples CompositeNode. Un archivo adjunto incrustado.
Examples
Examples CompositeNode. Una tabla dentro de un OutlineElement.
TableRow
Examples CompositeNode. Una fila dentro de un Table. Iterar GetChildNodes(TableCell) para acceder a las celdas.
TableCell
Examples CompositeNode. Una celda dentro de un TableRow. Contiene RichText, Image, y otros nodos de contenido.
NoteTag
Examples Node. Una etiqueta de OneNote adjunta a un nodo de contenido.
Nota de marca de tiempo: created y completed son marcas de tiempo enteras sin procesar extraídas del formato binario MS-ONE, no datetime objetos.
Métodos de fábrica:
NumberList
Examples Node. Metadatos de listas numeradas o con viñetas en un OutlineElement.
LoadOptions
SaveOptions
Clase base para todas las opciones de guardado. Argumento posicional requerido.
PdfSaveOptions
Examples SaveOptions. Configuración de exportación específica de PDF. Construir con PdfSaveOptions(SaveFormat.Pdf).
PageIndex / PageCount advertencia: Estos campos están declarados en PdfSaveOptions para compatibilidad de API, pero el Document.Save() implementación en v26.3.1 no los lee ni los reenvía al exportador PDF. Todas las páginas siempre se exportan.
Licencia y Medido
Stubs de compatibilidad exportados para la compatibilidad de forma de API con Aspose.Note para .NET. Todos los métodos son no operativos en esta implementación 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-opNo se requiere una clave de licencia para usar ninguna función de Aspose.Note FOSS para Python.
Examples
Referencia completa de la enumeración: Examples
SaveFormat
FileFormat
Valores de enumeración que representan la versión del formato de archivo OneNote. Document.FileFormat proporciona una indicación de mejor esfuerzo.
HorizontalAlignment
NodeType
Examples
Referencia completa de excepciones: Examples