NoteTag — Aspose.Note FOSS for Python API Reference

מחלקה: NoteTag

ImageRenderOptions: aspose.note ImageRenderOptions: from aspose.note import NoteTag ImageRenderOptions: Node

NoteTag מייצג סמל תגית של OneNote (כוכב, תיבת סימון, סמן חשוב, וכו’) שמצורף לצומת תוכן. תגיות מופיעות ב RichText, Image, AttachedFile, OutlineElement, ו Table צמתים דרך ה .Tags מאפיין.


ImageRenderOptions

כל המאפיינים הם לקריאה בלבד ומשקפים ערכים שנפרשו ישירות ממבנה הקובץ הבינארי MS-ONE.

ImageRenderOptionsImageRenderOptionsImageRenderOptionsImageRenderOptions
shape`intNone`None
label`strNone`None
text_color`intNone`None
highlight_color`intNone`None
created`intNone`None
completed`intNone`None

יורש מ-Node

ImageRenderOptionsImageRenderOptionsImageRenderOptions
ParentNode`NodeNone`
Document`DocumentNone`

הערת חותמת זמן

created ו completed הם חותמות זמן שלמות גולמיות כפי שנפרסו מתבנית הבינארית של MS-ONE. הם לא datetime אובייקטים. אם אתה צריך לעבוד איתם כ-Python תאריכים ושעות, עיין במפרט פורמט הקובץ של MS-ONE עבור נוסחת ההמרה.


שיטות ייצור

NoteTag.CreateYellowStar()

tag = NoteTag.CreateYellowStar() -> NoteTag

מחזיר חדש NoteTag עם shape=None ו label="Yellow Star". שימושי כאשר בונים מסמכים באופן תכנותי.


דוגמת שימוש

רשימת כל האלמנטים המתוייגים במסמך

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}")

סינון תגיות “To Do” שלא הושלמו

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

label, shape, text_color, highlight_color, created, ו completed כולם יכולים להיות None. Tags רשימות על צמתים של תוכן הן תמיד רשימות (לעולם לא None), אך עשוי להיות ריק.


ראה גם

 עברית