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: タグを持つ画像ノード
- 開発者ガイド