Aspose.Note FOSS for Python
Aquesta referència cobreix tota la superfície API pública de: aspose-note Versió 26.3.1. Només els símbols exportats des de la aspose.note Tot el que es troba sota la marca de l’equipatge està documentat aquí. aspose.note._internal és un detall d’aplicació i pot canviar sense previ avís.
Import: from aspose.note import Document, RichText, ...
Importació: from aspose.note import Document, RichText, ...
Classes
Install: pip install aspose-note (core) or pip install "aspose-note[pdf]" (with PDF export)
Document i travessa
| 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 document
| 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. |
Contenit
| 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. |
Opcions
Estampes de compatibilitat
Detalls de classe
Document
La classe de document raí. Carregar un .one arxiu d’una ruta de fitxer, un pathlib.Path, o un flux binari.
from aspose.note import Document, LoadOptions
doc = Document(source=None, load_options=None)Parametres del constructor:
Propietats:
Mètodes:
Document.FileFormatnota:: La propietat proporciona una indicació de millor esforç del format de fitxer OneNote.FileFormatenum té tres valors:OneNote2010,OneNoteOnline, iOneNote2007.
Document.Save()Suport de flux:targetpot ser un flux binari (io.BytesIO, màquina de fitxer oberta en mode d’escriptura binari, etc.).
DocumentVisitor
Classe de base abstracta per a la travessa del patró dels visitants. Sobrescriu els mètodes de visita que necessites:
Nòs
Classe base per a tots els nodes de l’arbre del document.
CompositeNode
Extensos Node.Adjunta la gestió de nens:
Pàgina
Extensos CompositeNode. Representa una pàgina OneNote.
Mètodes:
Títol
Extensos CompositeNode.Té el bloc de títol d’un Page.
Esbós de la història
Extensos CompositeNode.Un contenidor de posició per a: OutlineElement nodes.
OutlineElement
Extensos CompositeNode.Un contenidor de fulles que conté nodes.
RichText
Extensos Node.Un bloc de text amb estil.
Mètodes:
TextRun
Un únic segment de text formatat dins del sistema d’enllaç. RichText.TextRuns.
TextStyle
Propietats de formatació per caràcters d’un TextRun.
Imatge
Extensos CompositeNode.Una imatge incrustada.
Mètodes:
AttachedFile
Extensos Node.Un arxiu incrustat.
Taula de la Comissió
Extensos CompositeNode.Una taula dins d’un OutlineElement.
TableRow
Extensos CompositeNode.Una fila dins d’un Table.Iterat. GetChildNodes(TableCell) per accedir a les cel·les.
TableCell
Extensos CompositeNode.Una cel·la dins d’un TableRow.Conté: RichText, Image, i altres nodes de contingut.
NoteTag
Una etiqueta OneNote adjunta a un node de contingut.
Metodes d’obra en fàbrica:
NumberList
Metadades de llistes numerades o amb puntes en un OutlineElement.
LoadOptions
SaveOptions
Classe de base per a opcions d’estalvi. Argument posicional requerit.
PdfSaveOptions
Extensos SaveOptions. Configuració d’exportació específica per a PDF. Construir amb PdfSaveOptions() (tots els arguments són només per paraules clau amb paràmetres predeterminats).
PageIndex/PageCountadvertença:Aquests camps s’han de declarar en:PdfSaveOptionsper a la compatibilitat amb API, però elDocument.Save()La implementació en la v26.3.1 no s’aplica ni les transmet al exportador de PDF. Totes les pàgines sempre són exportades.
Licència i mètre
Estubs de compatibilitat exportats per a la compatibilització de forma d’API amb Aspose.Note per .NET. Tots els mètodes no són opcions en aquesta implementació 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 es requereix cap clau de llicència per utilitzar qualsevol característica de Aspose.Note FOSS for Python.
Enumeracions
Referència completa d’enumeració: Enumeracions
SaveFormat
FileFormat
Valors enum que representen la versió del format de fitxer OneNote. Document.FileFormat proporciona una indicació de millor esforç.
HorizontalAlignment
NodeType
Excepcions
Referència d’excepció completa: Excepcions