NoteTag — Aspose.Note FOSS for Python API Reference
Klasse: NoteTag
ImageRenderOptions: aspose.note ImageRenderOptions: from aspose.note import NoteTag ImageRenderOptions: Node
NoteTag vertegenwoordigt een OneNote‑tagpictogram (ster, selectievakje, belangrijk‑markering, enz.) dat aan een inhoudsknooppunt is gekoppeld. Tags verschijnen op RichText, Image, AttachedFile, OutlineElement, en Table knooppunten via hun .Tags eigenschap.
ImageRenderOptions
Alle eigenschappen zijn alleen-lezen en geven waarden weer die rechtstreeks uit het MS-ONE-binaire formaat zijn geparseerd.
| ImageRenderOptions | ImageRenderOptions | ImageRenderOptions | ImageRenderOptions |
|---|---|---|---|
shape | `int | None` | None |
label | `str | None` | None |
text_color | `int | None` | None |
highlight_color | `int | None` | None |
created | `int | None` | None |
completed | `int | None` | None |
Geërfd van Node
| ImageRenderOptions | ImageRenderOptions | ImageRenderOptions |
|---|---|---|
ParentNode | `Node | None` |
Document | `Document | None` |
Tijdstempelnotitie
created en completed zijn ruwe gehele tijdstempels zoals geparseerd uit het MS-ONE binaire formaat. Ze zijn niet datetime objecten. Als je ze als Python datum‑tijden moet gebruiken, raadpleeg dan de MS-ONE bestandsformaat‑specificatie voor de conversieformule.
Fabrieksmethoden
NoteTag.CreateYellowStar()
tag = NoteTag.CreateYellowStar() -> NoteTagRetourneert een nieuwe NoteTag met shape=None en label="Yellow Star". Handig bij het programmatisch opbouwen van documenten.
Gebruikvoorbeeld
Lijst alle getagde elementen in een document
from aspose.note import Document, RichText, Image, AttachedFile, OutlineElement
doc = Document("MyNotes.one")
# Tags on RichText
for rt in doc.GetChildNodes(RichText):
for tag in rt.Tags:
print(f"RichText tag: label={tag.label!r} on: {rt.Text.strip()[:40]!r}")
# Tags on Images
for img in doc.GetChildNodes(Image):
for tag in img.Tags:
print(f"Image tag: label={tag.label!r} file={img.FileName!r}")
# Tags on AttachedFiles
for af in doc.GetChildNodes(AttachedFile):
for tag in af.Tags:
print(f"Attachment tag: label={tag.label!r} file={af.FileName!r}")Filter voor onvoltooide “To Do”-tags
from aspose.note import Document, RichText
doc = Document("MyNotes.one")
for rt in doc.GetChildNodes(RichText):
for tag in rt.Tags:
if tag.label and "to do" in tag.label.lower() and tag.completed is None:
print(f"Incomplete TODO: {rt.Text.strip()!r}")None‑veiligheid
label, shape, text_color, highlight_color, created, en completed kunnen allemaal None. Controleer vóór gebruik. Tags lijsten op content‑knooppunten zijn altijd lijsten (nooit None), maar kunnen leeg zijn.
Zie ook
- ImageRenderOptions: basisklasse
- RichText: tekstknooppunten die tags dragen
- AttachedFile: bijlage‑knooppunten die tags dragen
- ImageRenderOptions: afbeeldingsknooppunten die tags dragen
- Ontwikkelaarsgids