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.
| 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 |
יורש מ-Node
| ImageRenderOptions | ImageRenderOptions | ImageRenderOptions |
|---|---|---|
ParentNode | `Node | None` |
Document | `Document | None` |
הערת חותמת זמן
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), אך עשוי להיות ריק.
ראה גם
- ImageRenderOptions: מחלקת בסיס
- RichText: צמתים טקסטואליים שנושאים תגיות
- AttachedFile: צמתים של קבצים מצורפים שנושאים תגיות
- ImageRenderOptions: צמתים של תמונות שנושאים תגיות
- מדריך למפתחים