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: 태그를 포함하는 이미지 노드
- 개발자 가이드