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

NameTypeAccessDescription
TitleTitle | NoneRead/WriteGets or sets the title.
Authorstr | NoneRead/WriteGets or sets the author.
CreationTimedatetime | NoneRead/WriteGets or sets the creation time.
LastModifiedTimedatetime | NoneRead/WriteGets or sets the last modified time.
Levelint | NoneRead/WriteGets or sets the level.
BackgroundColorint | NoneRead/WriteGets or sets the background color.
MarginAny | NoneRead/WriteGets or sets the margin.
SizeTypeAny | NoneRead/WriteGets or sets the size type.
PageLayoutSizeAny | NoneRead/WriteGets or sets the page layout size.
IsConflictPageboolRead/WriteGets or sets the is conflict page.
PageContentRevisionSummaryAny | NoneRead/WriteGets or sets the page content revision summary.
FirstChildNode | NoneReadGets the first child.
LastChildNode | NoneReadGets the last child.
ParentNodeNode | NoneReadGets the parent node.
DocumentDocument | NoneReadGets the document.

Methods

SignatureDescription
Clone(cloneHistory: bool) → PageCreates a copy of the page; if cloneHistory is true the page’s revision history is also copied
AppendChildLast(node: TNode) → TNodeCalls AppendChildLast(node) on this Page instance.
AppendChildFirst(node: TNode) → TNodeCalls AppendChildFirst(node) on this Page instance.
InsertChild(index: int, node: TNode) → TNodeCalls 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) -> Page
page.Accept(visitor: DocumentVisitor) -> None
from 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 ""
)

See Also

 English