Page
Overview
Page is a class in Aspose.Note FOSS for Python.
Inherits from: CompositeNode.
Page.Clone creates a copy of the page; if cloneHistory is true the page’s revision history is also copied.
This class provides 8 methods for working with Page objects in Python programs.
Available methods include: Accept, AppendChildFirst, AppendChildLast, Clone, GetChildNodes, GetEnumerator, InsertChild, RemoveChild.
All public members are accessible to any Python application after installing the Aspose.Note FOSS for Python package.
Properties: Author, BackgroundColor, CreationTime, Document, FirstChild, IsConflictPage, and 9 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Title | Title | None | Read/Write | Gets or sets the title. |
Author | str | None | Read/Write | Gets or sets the author. |
CreationTime | datetime | None | Read/Write | Gets or sets the creation time. |
LastModifiedTime | datetime | None | Read/Write | Gets or sets the last modified time. |
Level | int | None | Read/Write | Gets or sets the level. |
BackgroundColor | int | None | Read/Write | Gets or sets the background color. |
Margin | Any | None | Read/Write | Gets or sets the margin. |
SizeType | Any | None | Read/Write | Gets or sets the size type. |
PageLayoutSize | Any | None | Read/Write | Gets or sets the page layout size. |
IsConflictPage | bool | Read/Write | Gets or sets the is conflict page. |
PageContentRevisionSummary | Any | None | Read/Write | Gets or sets the page content revision summary. |
FirstChild | Node | None | Read | Gets the first child. |
LastChild | Node | None | Read | Gets the last child. |
ParentNode | Node | None | Read | Gets the parent node. |
Document | Document | None | Read | Gets the document. |
Methods
| Signature | Description |
|---|---|
Clone(cloneHistory: bool) → Page | Creates a copy of the page; if cloneHistory is true the page’s revision history is also copied |
AppendChildLast(node: TNode) → TNode | Calls AppendChildLast(node) on this Page instance. |
AppendChildFirst(node: TNode) → TNode | Calls AppendChildFirst(node) on this Page instance. |
InsertChild(index: int, node: TNode) → TNode | Calls InsertChild(index, node) on this Page instance. |
RemoveChild(node: Node) | Calls RemoveChild(node) on this Page instance. |
GetEnumerator() → Iterator[Node] | Calls GetEnumerator on this Page instance. |
GetChildNodes(node_type: type[TNode]) → list[TNode] | Calls GetChildNodes(node_type) on this Page instance. |
Accept(visitor: DocumentVisitor) | Calls Accept(visitor) on this Page instance. |
Examples
page.Clone(deep: bool = False) -> Pagepage.Accept(visitor: DocumentVisitor) -> Nonefrom aspose.note import Document, Page
doc = Document("MyNotes.one")
for page in doc.GetChildNodes(Page):
title = (
page.Title.TitleText.Text
if page.Title and page.Title.TitleText
else "(untitled)"
)
print(f" {title} author={page.Author} level={page.Level}")from aspose.note import Document, Page
doc = Document("MyNotes.one")
for page in doc.GetChildNodes(Page):
if page.Level and page.Level > 0:
title = page.Title.TitleText.Text if page.Title and page.Title.TitleText else ""
print(f"Sub-page (level={page.Level}): {title!r}")from aspose.note import Document, Page
doc = Document("MyNotes.one")
for page in doc.GetChildNodes(Page):
if page.Title:
if page.Title.TitleText:
print("Text:", page.Title.TitleText.Text)
if page.Title.TitleDate:
print("Date:", page.Title.TitleDate.Text)
if page.Title.TitleTime:
print("Time:", page.Title.TitleTime.Text)from aspose.note import Document, Page, RichText, Image, Table, AttachedFile
doc = Document("MyNotes.one")
page = doc.GetChildNodes(Page)[0] # first page
print(f"RichText: {len(page.GetChildNodes(RichText))}")
print(f"Images: {len(page.GetChildNodes(Image))}")
print(f"Tables: {len(page.GetChildNodes(Table))}")
print(f"Files: {len(page.GetChildNodes(AttachedFile))}")from aspose.note import Document, Page
doc = Document("MyNotes.one")
for page in doc.GetChildNodes(Page):
print(f"Created: {page.CreationTime}")
print(f"Modified: {page.LastModifiedTime}")title_text = (
page.Title.TitleText.Text
if page.Title and page.Title.TitleText
else ""
)