Outline / OutlineElement — Aspose.Note FOSS for Python API Reference
Klase: Outline
ImageRenderOptions: aspose.note ImageRenderOptions: from aspose.note import Outline ImageRenderOptions: CompositeNode
Outline ir pozicionēts konteineris, kas novietots tieši uz Page. Tas satur X/Y koordinātas un platumu, kas apraksta, kur satura bloks tiek izvietots lapas audeklā. Tā tiešās bērna elementi ir OutlineElement mezgli.
ImageRenderOptions
| ImageRenderOptions | ImageRenderOptions | ImageRenderOptions | ImageRenderOptions |
|---|---|---|---|
X | `float | None` | ImageRenderOptions |
Y | `float | None` | ImageRenderOptions |
Width | `float | None` | ImageRenderOptions |
Manto no CompositeNode
| Īpašība / Metode | ImageRenderOptions |
|---|---|
FirstChild | Pirmais tiešais bērns OutlineElement mezgls, vai None |
LastChild | Pēdējais tiešais bērns OutlineElement mezgls, vai None |
AppendChildLast(node) | Pievienot OutlineElement beigās |
AppendChildFirst(node) | Pievienot sākumā OutlineElement |
InsertChild(index, node) | Ievietot konkrētā pozīcijā |
RemoveChild(node) | Noņemt bērna mezglu |
GetChildNodes(Type) | Rekursīva dziļuma pirmās meklēšanas metode, kas atgriež visus dotā tipa pēcnācējus |
for child in outline | Iterēt tiešos bērnus |
Manto no Node
| ImageRenderOptions | ImageRenderOptions |
|---|---|
ParentNode | Saturošais Page |
Document | Sakne Document |
ImageRenderOptions
Accept(visitor)
outline.Accept(visitor: DocumentVisitor) -> NoneImageRenderOptions VisitOutlineStart(outline) uz apmeklētāja, tad rekursīvi apmeklē katru bērnu OutlineElement, tad VisitOutlineEnd(outline).
Lietošanas piemēri
Savākt visus outline elementus lapā
from aspose.note import Document, Page, Outline
doc = Document("MyNotes.one")
for page in doc.GetChildNodes(Page):
for outline in page.GetChildNodes(Outline):
print(f"Outline at X={outline.X}, Y={outline.Y}, Width={outline.Width}")Pārlūkot outline elementus noteiktā outline
from aspose.note import Document, Outline, OutlineElement, RichText
doc = Document("MyNotes.one")
for outline in doc.GetChildNodes(Outline):
for elem in outline.GetChildNodes(OutlineElement):
for rt in elem.GetChildNodes(RichText):
print(rt.Text)Klase: OutlineElement
ImageRenderOptions: aspose.note ImageRenderOptions: from aspose.note import OutlineElement ImageRenderOptions: CompositeNode
OutlineElement vai leaf container ir iekšā Outline. Tas satur satura mezglus, piemēram RichText, Image, Table, un AttachedFile. Ligšana tiek izteikta caur IndentLevel nevis faktiskais koka dziļums.
ImageRenderOptions
| ImageRenderOptions | ImageRenderOptions | ImageRenderOptions | ImageRenderOptions |
|---|---|---|---|
IndentLevel | int | ImageRenderOptions | Ligzdošanas dziļums struktūrā (0 = ārējais) |
NumberList | `NumberList | None` | ImageRenderOptions |
Tags | list[NoteTag] | ImageRenderOptions | OneNote birkas pievienotas šim elementam |
Manto no CompositeNode
| Īpašība / Metode | ImageRenderOptions |
|---|---|
FirstChild | Pirmais tiešais satura bērns |
LastChild | Pēdējais tiešais satura bērns |
AppendChildLast(node) | Pievienot satura mezglu |
GetChildNodes(Type) | Rekursīva meklēšana apakškokā |
for child in elem | Iterēt tiešos bērnus |
Manto no Node
| ImageRenderOptions | ImageRenderOptions |
|---|---|
ParentNode | Saturošais Outline |
Document | Sakne Document |
ImageRenderOptions
Accept(visitor)
elem.Accept(visitor: DocumentVisitor) -> NoneImageRenderOptions VisitOutlineElementStart(elem), rekursīvi apmeklē bērnus, tad VisitOutlineElementEnd(elem).
Lietošanas piemēri
Izgūt vienkāršu tekstu no outline elementiem
from aspose.note import Document, OutlineElement, RichText
doc = Document("MyNotes.one")
for elem in doc.GetChildNodes(OutlineElement):
for rt in elem.GetChildNodes(RichText):
if rt.Text.strip():
print(f" [indent={elem.IndentLevel}] {rt.Text}")Atrast saraksta vienumus
from aspose.note import Document, OutlineElement, RichText
doc = Document("MyNotes.one")
for elem in doc.GetChildNodes(OutlineElement):
if elem.NumberList is not None:
numbered = elem.NumberList.IsNumbered
label = "ordered" if numbered else "bulleted"
for rt in elem.GetChildNodes(RichText):
print(f" [{label}] {rt.Text}")Atrast marķētus outline elementus
from aspose.note import Document, OutlineElement, RichText
doc = Document("MyNotes.one")
for elem in doc.GetChildNodes(OutlineElement):
if elem.Tags:
labels = [t.label for t in elem.Tags if t.label]
for rt in elem.GetChildNodes(RichText):
print(f"Tags: {labels} Text: {rt.Text.strip()!r}")Izveidot outline programmatiskā veidā
from aspose.note import Document, Page, Outline, OutlineElement, RichText, SaveFormat
doc = Document()
page = doc.AppendChildLast(Page())
outline = page.AppendChildLast(Outline())
elem = outline.AppendChildLast(OutlineElement())
rt = elem.AppendChildLast(RichText())
rt.Append("Hello from aspose-note")
doc.Save("output.pdf", SaveFormat.Pdf)None drošība
NumberList ir None elementiem, kas nav daļa no saraksta. Tags vienmēr ir saraksts (var būt tukšs). IndentLevel vienmēr ir int (noklusējums 0).
Skatīt arī
- ImageRenderOptions: Outline vecāks
- RichText: galvenais saturs iekš OutlineElement
- ImageRenderOptions: tabulas saturs iekš OutlineElement
- NumberList: saraksta formatēšanas metadati
- NoteTag: tagi uz outline elements
- DocumentVisitor: apmeklētāja pārlūkošana