Aspose.Note FOSS for Python
Esta referência cobre toda a superfície da API pública de aspose-note versão 26.3.1. Apenas símbolos exportados do aspose.note pacote são documentados aqui. Qualquer coisa sob aspose.note._internal é um detalhe de implementação e pode mudar sem aviso prévio.
ImageRenderOptions: pip install aspose-note (core) ou pip install "aspose-note[pdf]" (com exportação PDF)
ImageRenderOptions: from aspose.note import Document, RichText, ...
ImageRenderOptions
Documento e Percurso
| 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. |
Estrutura do 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. |
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
Stubs de Compatibilidade
Detalhes da Classe
ImageRenderOptions
A classe de documento raiz. Carregue um .one arquivo a partir de um caminho de arquivo, um pathlib.Path, ou um fluxo binário.
from aspose.note import Document, LoadOptions
doc = Document(source=None, load_options=None)Parâmetros do construtor:
ImageRenderOptions:
ImageRenderOptions:
Document.FileFormat nota: A propriedade fornece uma indicação de melhor esforço da versão do formato de arquivo OneNote. O FileFormat enum tem três valores: OneNote2010, OneNoteOnline, e OneNote2007.
Document.Save() suporte a fluxo: target pode ser um fluxo binário (io.BytesIO, manipulador de arquivo aberto em modo de escrita binária, etc.). Isso é confirmado pela suíte de testes: doc.Save(io.BytesIO(), PdfSaveOptions(SaveFormat.Pdf)).
DocumentVisitor
Classe base abstrata para percorrimento usando o padrão visitor. Substitua os métodos de visita que precisar:
ImageRenderOptions
Classe base para todos os nós da árvore de documentos.
CompositeNode
ImageRenderOptions Node. Adiciona gerenciamento de filhos:
ImageRenderOptions
ImageRenderOptions CompositeNode. Representa uma página do OneNote.
ImageRenderOptions:
ImageRenderOptions
ImageRenderOptions CompositeNode. Contém o bloco de título de um Page.
ImageRenderOptions
ImageRenderOptions CompositeNode. Um contêiner posicional para OutlineElement nós.
OutlineElement
ImageRenderOptions CompositeNode. Um contêiner folha que contém nós de conteúdo.
RichText
ImageRenderOptions CompositeNode. Um bloco de texto formatado.
ImageRenderOptions:
TextRun
ImageRenderOptions Node. Um único segmento de texto formatado.
TextStyle
ImageRenderOptions Node. Propriedades de formatação por caractere para um TextRun.
ImageRenderOptions
ImageRenderOptions CompositeNode. Uma imagem incorporada.
ImageRenderOptions:
AttachedFile
ImageRenderOptions CompositeNode. Um anexo de arquivo incorporado.
ImageRenderOptions
ImageRenderOptions CompositeNode. Uma tabela dentro de um OutlineElement.
TableRow
ImageRenderOptions CompositeNode. Uma linha dentro de um Table. Iterar GetChildNodes(TableCell) para acessar células.
TableCell
ImageRenderOptions CompositeNode. Uma célula dentro de um TableRow. Contém RichText, Image, e outros nós de conteúdo.
NoteTag
ImageRenderOptions Node. Uma tag do OneNote anexada a um nó de conteúdo.
Nota de timestamp: created e completed são timestamps inteiros brutos analisados a partir do formato binário MS-ONE, não datetime objetos.
Métodos de fábrica:
NumberList
ImageRenderOptions Node. Metadados de lista numerada ou com marcadores em um OutlineElement.
LoadOptions
SaveOptions
Classe base para todas as opções de salvamento. Argumento posicional obrigatório.
PdfSaveOptions
ImageRenderOptions SaveOptions. Configuração de exportação específica para PDF. Construir com PdfSaveOptions(SaveFormat.Pdf).
PageIndex / PageCount advertência: Esses campos são declarados em PdfSaveOptions para compatibilidade de API, mas o Document.Save() implementação na v26.3.1 não lê nem encaminha-os para o exportador PDF. Todas as páginas são sempre exportadas.
Licença e Medição
Stubs de compatibilidade exportados para compatibilidade de forma de API com Aspose.Note para .NET. Todos os métodos são no-ops nesta implementação 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-opNenhuma chave de licença é necessária para usar qualquer recurso do Aspose.Note FOSS para Python.
ImageRenderOptions
Referência completa da enumeração: ImageRenderOptions
SaveFormat
FileFormat
Valores da enumeração que representam a versão do formato de arquivo OneNote. Document.FileFormat fornece uma indicação de melhor esforço.
HorizontalAlignment
NodeType
ImageRenderOptions
Referência completa de exceções: ImageRenderOptions